-
-
Notifications
You must be signed in to change notification settings - Fork 238
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
feat: add support for the Jekyll markdownify filter #621
feat: add support for the Jekyll markdownify filter #621
Conversation
I have selected Marked as the library to use for the MD > HTML conversion and I am using isomorphic-dompurify because normal DOMPurify doesn't work in the test runner (it only works in the browser environment while isomorphic-dompurify is a wrapper that runs on both browser and Node).
Typos everywhere!
- `git switch -c your_branch_name` (do this in your fork not the main repo) | ||
- `git add .` | ||
- `git commit -m "feat: Adding my change"` | ||
- `git commit -m "feat: adding my change"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fix this because it is not compatible with the commit lint used in the repository and when I was creating this document I didn't yet know the rules it enforced very well so this slipped in.
@@ -104,7 +105,9 @@ | |||
"typescript": "^4.5.3" | |||
}, | |||
"dependencies": { | |||
"commander": "^10.0.0" | |||
"commander": "^10.0.0", | |||
"isomorphic-dompurify": "^1.6.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using isomorphic-dompurify
over normal dompurify
because that doesn't run in Node and was failing in the test runner. isomorphic-dompurify
runs in both the browser and Node.
The `stringify` helper always returns a valid string.
"commander": "^10.0.0" | ||
"commander": "^10.0.0", | ||
"isomorphic-dompurify": "^1.6.0", | ||
"marked": "^5.0.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I chose Marked because it is the most popular regularly maintained Markdown to HTML converter NPM package I could find.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made sure this remained in lockfile version 1 but the diff is still pretty wild because isomorphic-dompurify
brings in jsdom
which itself depends on a lot of stuff.
There are two problems with this PR: It doesn't work in older Node versions (as used in the Check workflow):
JSDOM's minimal Node version is Node 16: LiquidJS minimal Node version is Node 14: The Check CI is using Node 14: @harttle Are you open to bumping the minimal Node version to 16? And it doesn't work when I build and use the built file in the Playground. Testing with:
@harttle Is there a way to do a non-minimized build so that I could check what the error is? My browser has not picked up the source map. |
@@ -4,6 +4,8 @@ | |||
* * prefer stringify() to String() since `undefined`, `null` should eval '' | |||
*/ | |||
import { assert, escapeRegExp, stringify } from '../util' | |||
import { marked } from 'marked' | |||
import { sanitize } from 'isomorphic-dompurify' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently liquidjs has only one run time dependency commander
and that is not included in dist files. Let's avoid introducing dependencies.
Markdown functionality is better to be maintained in another repo, maybe liquidjs-plugin-markdown, or liquidjs-plugin-jekyll.
@TomasHubelbauer There is a non minified build under |
Closing the PR for now and will redo as a LiquidJS filter once clearer on how to do that. |
I have selected Marked as the library to use for the MD > HTML conversion and I am using isomorphic-dompurify because normal DOMPurify doesn't work in the test runner (it only works in the browser environment while isomorphic-dompurify is a wrapper that runs on both browser and Node).
Closes #620