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

Would a pull request that adds notation information to some tokens be welcome? #128

Closed
marijnh opened this issue Jan 6, 2015 · 4 comments

Comments

@marijnh
Copy link

marijnh commented Jan 6, 2015

I'm building a tool that uses Remarkable's parser to build up an AST, then does some stuff with that AST, and reserializes it. I'd like to have the resulting output be as close to the input as possible, but it currently is somewhat awkward to find out things like

  • Which bullet character was used for a bullet list
  • Whether strong/em spans used asterisks or underscores around the text
  • Whether a header uses ATX or Setext style
  • Whether a link used inline syntax or defined a separate reference

These can be made much easier by having some extra properties on the corresponding tokens. If you have no problem with this, I'll submit a simple pull request to extend these tokens.

@marijnh marijnh closed this as completed Jan 6, 2015
@sbruchmann
Copy link

Just wondering why you closed this issue, @marijnh. I’m interested in this too!

@leeoniya
Copy link

leeoniya commented Jan 6, 2015

my hope is that @marijnh's building a markdown AST <> html AST so they can be edited interchangeably in a side-by-side codemirror/WYSIWYG setup :)

i've done something in the same ballpark with reMarked.js [1]... demo integration with redactor: [2], fork: [3], lots of discussion about the need [4][5]. dunno if there's a request/thread for Squire [6] yet, but there probably will be. Now that markdown has an official AST (it didnt when i started reMarked), this goal should be achievable and possibly even integrateble with operational transforms for collab, etc.

[1] https://github.com/leeoniya/reMarked.js
[2] https://leeoniya.github.io/redactor-js/
[3] https://github.com/leeoniya/redactor-js/tree/markdown-panel
[4] html5cat/redactor-js#2
[5] slab/quill#74
[6] https://github.com/neilj/Squire

@sbruchmann
Copy link

@leeoniya Oh, wow. Exactly what I was looking for! Thank you!

@marijnh
Copy link
Author

marijnh commented Jan 6, 2015

I closed this because I've decided to use https://github.com/markdown-it/markdown-it instead.

I may indeed be trying to pull of such an editor, but whether it is going to work, and whether the customer who I'm writing it for will open-source it, remains to be seen.

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

No branches or pull requests

3 participants