-
Notifications
You must be signed in to change notification settings - Fork 146
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
Output as Text #26
Comments
To clarify - you are not looking for plain text output but rather markdown output, preserving all the little details? One problem that I see right away - inline links and reference links - the details on how they were entered are not preserved. So the formatter has to choose the resulting formatting - but what should it be? For example, are the references added after the paragraph or at the end? Does it use numeric reference labels or creates some magic strings? |
Correct, I want to preservie the mMarkdown although some interpretation, as you point out, will occur. I don't use references so I can't speak to the issue. Pandoc reformats # headers into === and --- headers. I imagine there are some other things it does like thatl, but nothing I have ever been bothered by. Hard line breaks make reading text from the console a bit nicer. |
Header texts can be left alone - AST contains information from which format it was parsed. I would avoid converting them between formats. For now reference links seem to be the only thing that loses significant information during parsing. |
I have started work on this in the md-writer branch. Perhaps you could try it out and list the issues you can find. Some I know already:
|
ooooh, new shiny to play with this weekend. Thanks! On Thu, Mar 5, 2015 at 3:50 PM, Kārlis Gaņģis [email protected]
|
Hey, this is looking nice. Here's something I noticed
is formatted as
I think in the spirit of, "keeping it pretty", we should either keep the number of underlines elements in the original document or better still, match the number of underline elements to the length of the text. The parser correctly preserves In ordered and unordered lists, the original indent is not preserved
is rendered as
This is not big issue. However, when I write markdown I usually indent these items a couple of spaces to simulate how they appear in HTML If preserving the original indentation is difficult, I would settle for a configuration option. Same thing goes for blocks quotes. Source indentation in not preserved. Finally, the following:
renders as:
Should there be a blank line b/t the numbered list and block quote? That's all for now. Great job! |
Horizontal breaks present some interesting challenges.
is currently output as
Couple of options here.
Not sure what I want here. |
I will change this to match the number of characters in the previous line
I think that the parser preserves this information so the list could be indented based on the first item.
that is a bug coming from the fact that the list is tight so the paragraphs do not render the newline. this should be easy to fix.
I suppose that the only reasonable solution is to add a configuration option on how many dashes to add. Leaving the count from the source goes against the idea of reformatting the document accoring to a single style. Thank you for the feedback! |
I agree on all your points. |
One other thought. You might want to include a configuration to always force H1/H2 headers to underline. Or if you're really crazy a 3 way setting.
|
I'm looking for a new feature to add to Markdown Edit this weekend. Hint, hint, hint 😄 |
Unfortunately I had no time to work on this so it is still in the state you last reviewed... |
Any movement on this guys? Is it still living in the branch? Any idea what kind of work is outstanding and if I can contribute to get it out and into a release? Cheers. |
Just FYI, I am interested in a markdown parser that can do full-fidelity "round trip", as well as normalization on top of that. The work described in this thread seems aimed at normalization, but being able to just do round-trip (emitting the exact same text as the original output) is also useful when you want to do programmatic transformations without mucking about with the existing style. |
I'm back with my hat in hand :)
Plain text output please, with hard line breaks at a set column.
Currently I do this with pandoc
Then I could build refomatter into Markdown Edit.
The text was updated successfully, but these errors were encountered: