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

Unify markdown-it parser variants #1056

Merged
merged 1 commit into from
Mar 22, 2020

Conversation

ang-zeyu
Copy link
Contributor

What is the purpose of this pull request? (put "X" next to an item, remove the rest)

• [x] Documentation update
• [x] Other, please explain:

As mentioned here: #975 (comment)

What is the rationale for this request?

To standardise the two parser variants used for attributes in components and all other cases,
which should reduce the potential matainence needed, and standardises the feature set
across the two locations.

As a result:

Two markdown-it plugins vue-strap has but MarkBind dosen't were added:
  • markdown-it-sub ( uses ~...~ )
  • markdown-it-sup ( uses ^...^ )
Three markdown-it plugins MarkBind has but vue-strap dosen't were added to vue attributes:
  • markdown-it-attrs ( uses { ... } )
  • markdown-it-footnotes ( uses [^footnoteidentifier] or ^[inline footnote] )
    • the caveat here is that non-inline footnotes don't work here as they are parsed in seperate runs, although inline ones still do.
  • markdown-it-linkify-images ( no syntax changes )
Markdown-it plugins MarkBind has but vue-strap dosen't, but would not be used in attributes anyway, and dosen't conflict with existing syntax:
  • markdown-it-table-of-contents ( uses [[toc]] )
  • markdown-it-task-lists ( uses 1./*/- [x] )
  • markdown-it-block-embed ( uses @[youtube](lJIrF4YjHfQ) )
  • markdown-it-radio-button ( uses - ( ) Item 1 )

What changes did you make? (Give an overview)

  • Merged the two parser variants into one
  • Corresponding documentation was updated for the above changes

Is there anything you'd like reviewers to focus on?
na

Testing instructions:

  • npm run test should pass
  • build on the 2103 site should have no diffs, save for timestamps and logs

Proposed commit message: (wrap lines at 72 characters)
Unify markdown-it parser variants

The markdown-it parser used for attributes in components
uses a different set of plugins from the one used throughout markbind.

Let's unify the two variants to reduce the potential amount of
maintainence needed, and standardise the usable markdown
syntax throughout markbind.

@openorclose
Copy link
Contributor

LGTM

Unsure if we need to be concerned that authors can use markdown syntax that don't make sense in attributes though.

@ang-zeyu
Copy link
Contributor Author

ang-zeyu commented Feb 26, 2020

Unsure if we need to be concerned that authors can use markdown syntax that don't make sense in attributes though.

I would think its better we leave that to the author's discretion, since its better to have things work where expected as far as markdown goes.
E.g. since our docs states that box headers 'support markdown text', one would expect block level markdown ( e.g. markdown-it-task-lists ) to work in there as well, although the use cases for it are probably zero.


Will update back if there are more changes other than rebasing on master

@ang-zeyu ang-zeyu force-pushed the unify-markdown-it-variants branch 5 times, most recently from 7419bde to 8334f40 Compare March 7, 2020 13:21
@ang-zeyu
Copy link
Contributor Author

ang-zeyu commented Mar 7, 2020

Moved markdown-it-escape-special-tags from #1047 back to the markdown-it folder as well

The markdown-it parser used for attributes in components
uses a different set of plugins from the one used throughout markbind.

Let's unify the two variants to reduce the potential amount of
maintainence needed, and standardise the usable markdown
syntax throughout markbind.
@yamgent yamgent added this to the v2.12.1 milestone Mar 15, 2020
@yamgent yamgent merged commit 690bb6f into MarkBind:master Mar 22, 2020
Tejas2805 added a commit to Tejas2805/markbind that referenced this pull request Mar 23, 2020
* 'master' of https://github.com/MarkBind/markbind:
  Update test files (MarkBind#1138)
  Remove OK button from modals (MarkBind#1134)
  Add start from line number functionality to code blocks (MarkBind#1115)
  Allow special tags to be self-closing (MarkBind#1101)
  Simplify baseUrl resolving process (MarkBind#1087)
  Remove redundant file writing (MarkBind#1090)
  Bump acorn from 5.7.3 to 5.7.4 (MarkBind#1121)
  Bump acorn from 7.1.0 to 7.1.1 in /src/lib/markbind (MarkBind#1120)
  Unify markdown-it parser variants (MarkBind#1056)
  Remove dynamic include feature (MarkBind#1037)
  Fix flex shrink not applying in content wrapper (MarkBind#1135)
  Escape Nunjucks for special tags (MarkBind#1049)
  Update documentation on icon slot for boxes (MarkBind#1123)
Tejas2805 added a commit to Tejas2805/markbind that referenced this pull request Mar 23, 2020
…x-pageNav

* 'master' of https://github.com/MarkBind/markbind:
  Update test files (MarkBind#1138)
  Remove OK button from modals (MarkBind#1134)
  Add start from line number functionality to code blocks (MarkBind#1115)
  Allow special tags to be self-closing (MarkBind#1101)
  Simplify baseUrl resolving process (MarkBind#1087)
  Remove redundant file writing (MarkBind#1090)
  Bump acorn from 5.7.3 to 5.7.4 (MarkBind#1121)
  Bump acorn from 7.1.0 to 7.1.1 in /src/lib/markbind (MarkBind#1120)
  Unify markdown-it parser variants (MarkBind#1056)
  Remove dynamic include feature (MarkBind#1037)
  Fix flex shrink not applying in content wrapper (MarkBind#1135)
  Escape Nunjucks for special tags (MarkBind#1049)
  Update documentation on icon slot for boxes (MarkBind#1123)
  Convert code in boxes to code block (MarkBind#1086)
marvinchin pushed a commit that referenced this pull request Apr 10, 2020
The markdown-it parser used for attributes in components
uses a different set of plugins from the one used throughout markbind.

Let's unify the two variants to reduce the potential amount of
maintainence needed, and standardise the usable markdown
syntax throughout markbind.
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.

None yet

3 participants