Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement/issue 1320 upgrade markdown related dependencies to latest #1371

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion greenwood.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export default {
'@mapbox/rehype-prism',
'rehype-slug',
'rehype-autolink-headings',
'remark-github'
'remark-github',
'remark-gfm'
]
}
};
12 changes: 6 additions & 6 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@
"livereload": "^0.9.1",
"markdown-toc": "^1.2.0",
"node-html-parser": "^1.2.21",
"rehype-raw": "^5.0.0",
"rehype-stringify": "^8.0.0",
"remark-frontmatter": "^2.0.0",
"remark-parse": "^8.0.3",
"remark-rehype": "^7.0.0",
"rehype-raw": "^7.0.0",
"rehype-stringify": "^10.0.1",
"remark-frontmatter": "^5.0.0",
"remark-parse": "^11.0.0",
"remark-rehype": "^11.1.1",
"rollup": "^4.26.0",
"unified": "^9.2.0",
"unified": "^11.0.5",
"wc-compiler": "~0.15.1"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/lifecycles/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const defaultConfig = {
optimization: optimizations[0],
activeContent: false,
plugins: greenwoodPlugins,
markdown: { plugins: [], settings: {} },
markdown: { plugins: [] },
prerender: false,
isolation: false,
pagesDirectory: 'pages',
Expand Down Expand Up @@ -183,7 +183,6 @@ const readAndMergeConfig = async() => {

if (markdown && Object.keys(markdown).length > 0) {
customConfig.markdown.plugins = markdown.plugins && markdown.plugins.length > 0 ? markdown.plugins : [];
customConfig.markdown.settings = markdown.settings ? markdown.settings : {};
}

if (port) {
Expand Down
14 changes: 6 additions & 8 deletions packages/cli/src/plugins/resource/plugin-standard-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import remarkRehype from 'remark-rehype';
import { ResourceInterface } from '../../lib/resource-interface.js';
import { getUserScripts, getPageLayout, getAppLayout } from '../../lib/layout-utils.js';
import { requestAsObject } from '../../lib/resource-utils.js';
import unified from 'unified';
import { unified } from 'unified';
import { Worker } from 'worker_threads';
import htmlparser from 'node-html-parser';

Expand Down Expand Up @@ -69,10 +69,8 @@ class StandardHtmlResource extends ResourceInterface {
}
}

const settings = config.markdown.settings || {};

processedMarkdown = await unified()
.use(remarkParse, settings) // parse markdown into AST
.use(remarkParse) // parse markdown into AST
.use(remarkFrontmatter) // extract frontmatter from AST
.use(remarkPlugins) // apply userland remark plugins
.use(remarkRehype, { allowDangerousHtml: true }) // convert from markdown to HTML AST
Expand Down Expand Up @@ -127,22 +125,22 @@ class StandardHtmlResource extends ResourceInterface {

if (processedMarkdown) {
const wrappedCustomElementRegex = /<p><[a-zA-Z]*-[a-zA-Z](.*)>(.*)<\/[a-zA-Z]*-[a-zA-Z](.*)><\/p>/g;
const ceTest = wrappedCustomElementRegex.test(processedMarkdown.contents);
const ceTest = wrappedCustomElementRegex.test(processedMarkdown.value);

if (ceTest) {
const ceMatches = processedMarkdown.contents.match(wrappedCustomElementRegex);
const ceMatches = processedMarkdown.value.match(wrappedCustomElementRegex);

ceMatches.forEach((match) => {
const stripWrappingTags = match
.replace('<p>', '')
.replace('</p>', '');

processedMarkdown.contents = processedMarkdown.contents.replace(match, stripWrappingTags);
processedMarkdown.value = processedMarkdown.value.replace(match, stripWrappingTags);
});
}

// https://github.com/ProjectEvergreen/greenwood/issues/1126
body = body.replace(/\<content-outlet>(.*)<\/content-outlet>/s, processedMarkdown.contents.replace(/\$/g, '$$$'));
body = body.replace(/\<content-outlet>(.*)<\/content-outlet>/s, processedMarkdown.value.replace(/\$/g, '$$$'));
} else if (matchingRoute.external) {
body = body.replace(/\<content-outlet>(.*)<\/content-outlet>/s, matchingRoute.body);
} else if (ssrBody) {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"rehype-autolink-headings": "^4.0.0",
"rehype-slug": "^3.0.0",
"remark-github": "^10.0.1",
"remark-gfm": "^4.0.0",
"rollup-plugin-analyzer": "^4.0.0"
}
}
102 changes: 102 additions & 0 deletions www/pages/definition-list-formatted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
title: Anti-Hermione
collection: Bookmarks
description: HP Stories Notable for the Anti-Hermione Bias
author: Luke Schierer
---

<dl>

<dt>_[Careless Talk](https://archiveofourown.org/works/13163049)_</dt>
<dd>Author: [sbmcneil](https://archiveofourown.org/works/13163049)</dd>
<dd>Published: 2017-12-27</dd>
<dd>
Comments: There is a tone shift between the end of _[Goblet of Fire]_ and the beginning of _[Order of the Phoenix]_. In the Former, [Sirius] is an adult, someone that [Hermione] encourages [Harry] to confide in. By that summer, staying in [Grimmauld Place], she will have taken on a more critical view, and will be the one adult that she does not seem to believe deserves real respect. This book explores three possibilities. One that [Harry] and [Ginny] become close during book four, rather than [Ginny] trying to find herself in other relationships. Second that [Sirius] was unwilling to stay out of [Harry]'s life, but insisted on being part of it. Third that [Ron] and [Hermione], he out of jealousy and she out of her distrust of the relationship, can neither one be trusted with the secrets that [Harry]'s adventures have caused them to be hold.
</dd>

<dt>_[Not the Smartest Witch]_</dt>
<dd>Author: [White Angel of Auralon](https://www.fanfiction.net/u/2149875/White-Angel-of-Auralon)</dd>
<dd>Published: 2014-06-08</dd>
<dd>
Unfortunately despite the promising premise, this is simply a rather poorly executed bashing story. The book goes alternate universe in that [Harry] is rather more widely curious than in [canon], and so looks up the student files to follow up on suspicions he has about student performance. So far so good. The investigation shows some believable results:
* [Hermione] has mediocre magical strength - in [canon] we do not
actually have a reliable comparison of the relative magical strength of the various students.
* [Hermione] knows the spells, but is too eagerly pushing on to new
knowledge to fully explore the fine details of things already covered. She wants to impress with things not known by others, rather than spending time working on things she "already knows."
This is less in line with the [canonical] characterisation.
* [Hermione] gets penalised for her over-length essays. Honestly
this *should* have happened in the books.
* [Ron] is a fairly stereotypical bashing representation, poor
grammar, poor study habits, refusal to correct either. Sure
the [canonical] [Ron] *does* have poor study habits, but he does pass most of his courses with "exceeds" scores.
</dd>

<dt>_[Hermione's Pity Party](https://www.fanfiction.net/s/11378607)_</dt>
<dd>Author: [Madhatter1981](https://www.fanfiction.net/u/2584154/Madhatter1981)</dd>
<dd>Published: 2015-07-13</dd>
<dd>
This is a more realistic take on the same premise as _[Not the Smartest Witch]_. Here [McGonagall] is attempting to actually be head of house, almost moving this into the [Responsible Adult] category.
</dd>

<dt>_[HJG: The Smartest Witch of Her Age?](https://www.fanfiction.net/s/5858832/)_</dt>
<dd>Author: [HarnGin](https://www.fanfiction.net/u/1220787/HarnGin)</dd>
<dd>Published: 2010-03-31</dd>
<dd>
This story is exceptionally unbelievable in that if the [Unspeakables]
truly thought so little of [Hermione], they would not have brought her
in for an "interview" just to tell her, in fair detail, just how little they thought of her and why. It is however, an amusing summation of
things that *could* have been done differently across the series if she
where to really be the brilliant girl genius.
</dd>

<dt>_[Golden Bullets](https://archiveofourown.org/works/18935341/)_</dt>
<dd>Author: [CescaLR](https://archiveofourown.org/users/CescaLR/pseuds/CescaLR)</dd>
<dd>Published: 2019-06-04. Updated: 2020-10-07. Unfinished.</dd>
<dd>
The biggest flaw with this one is that it is unlikely that as late as year six the teachers would *finally* take notice of just about anything
and act responsibly. On the other hand, year six is the year that [Harry] gets detention every week for mishandling the fight in the bathroom.[^240325-1] As this is also an attack on a pure-blood by someone of lesser standing, this might be seen in a similar light.
I like the positive spin on [Lavender], and the way [Ginny] realises that she's taken bad advice. Some of the other side characters brought to prominence are also interesting. The redemption arc with [Marietta]
is clearly very interesting to the author, and related in that [Hermione] also triggered [Marietta]'s situation, but I do not care for
it. I suspect the author has been unable to finish the story because she included too many side threads, and that focusing on fewer of them would have allowed for greater clarity of execution.
</dd>

<dt>_[Broken](https://archiveofourown.org/works/19323346)_</dt>
<dd>Author: [StarsandSunkissed](https://archiveofourown.org/users/StarsandSunkissed/pseuds/StarsandSunkissed)</dd>
<dd>Published: 2019-06-22</dd>
<dd>
Ultimately this one-shot falls down because it *is* a one-shot. Such a break would have massive ripples down across book seven, and we have no indication of how those fall out. How does [Harry] navigate a world in which [Ron] and [Hermione] have irrevocably parted ways this way?
</dd>

<dt>_[Hermione Granger and The Obliviated Parents](https://www.fanfiction.net/s/13204936)_</dt>
<dd>Author: [ZebJeb](https://www.fanfiction.net/u/10283561/ZebJeb)</dd>
<dd>Published: 2019-02-12</dd>
<dd>
The [Granger] family is dysfunctional, so it is no surprise that they cannot reconcile after [Hermione] restores her parents memories.
</dd>
</dl>

[Granger]: /Harrypedia/people/Granger/
[Marietta]: /Harrypedia/people/Edgecombe/Marietta/
[Ginny]: /Harrypedia/people/Weasley/Ginevra_Molly/
[Lavender]: /Harrypedia/people/Brown/Lavender/
[Not the Smartest Witch]: https://www.fanfiction.net/s/10434054
[Responsible Adult]: ./responsibleadults/
[McGonagall]: /Harrypedia/people/McGonagall/Minerva/
[Unspeakables]: /Harrypedia/unspeakables/
[Ron]: /Harrypedia/people/Weasley/Ronald_Bilius/
[Hermione]: /Harrypedia/people/Granger/Hermione_Jean/
[Harry]: /Harrypedia/people/Potter/Harry_James/
[canon]: /Harrypedia/
[canonical]: /Harrypedia/
[Sirius]: /Harrypedia/people/Black/Sirius_iii/
[Grimmauld Place]: /Harrypedia/grimmauld_place/

[^240325-1]:
Mrs. J. K. Rowling.
_[Harry Potter and the Half-Blood Prince]_
Bloomsbury, London, 2005. Page 439.

[Harry Potter and the Half-Blood Prince]: https://www.librarything.com/work/1133624
[Prisoner of Azkaban]: https://www.librarything.com/work/2742161
[Order of the Phoenix]: https://www.librarything.com/work/115
[Goblet of Fire]: https://www.librarything.com/work/113
Loading
Loading