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

Token finalization to replace imprimitive attribute string #169

Merged
merged 3 commits into from
Jun 10, 2019

Conversation

yhatt
Copy link
Member

@yhatt yhatt commented Jun 4, 2019

To detect Marpit's color shorthand by the value before validation, Marpit v1.1.0 uses imprimitive string created by new String('foobar') as an attribute for URL. (#165)

By this change, we found that it has breaking an integration with the markdown-it renderer in Marp for VS Code. (typeof new String('foobar') returns object, not string) marp-vscode v0.5.0 has fixed a render rule individually.

I've added token finalization to replace imprimitive attribute string with primitive value by toString().

markdown-it always expects string as the attribute value. Thus, we believe that this finalization would not cause any other integration problems.


context('with header image via directive', () => {
const tokens = md().parse(
'<!-- header: "![](header.png)" -->\n\n![](content.png)'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: Image in header directive is an edge case of #165 that try to override exists State#process function twice.

@yhatt yhatt merged commit f2db86f into master Jun 10, 2019
@yhatt yhatt deleted the fix-imprimitive-string-attribute branch June 10, 2019 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant