Comments (2)
Some of the options are render options, others are parsing
options. There are no options that are used in both phases.
Parsing: NORMALIZE, VALIDATE_UTF8, SMART
Rendering: SOURCEPOS, SAFE, HARDBREAKS
This could be clearer from the cmark.3 man page, because
currently the options are under a heading "Rendering."
Originally we only had writer options.
I don't want to store render options in the parse tree,
since the same parsed AST might be rendered in different
ways. But maybe it would make sense to more clearly
distinguish between reader and writer options, either in
cmark, or in the ruby wrapper, or both places.
+++ Garen Torikian [Oct 25 15 13:21 ]:
An interesting issue came up on the [1]Ruby wrapper for libcmark.
It looks like, in order to render a string into a document, and that
document into HTML, you must pass the rendering options twice, like
this:doc = CommonMarker.render_doc(markdown, [:smart, :hardbreaks])
assert_equal result, doc.to_html([:smart, :hardbreaks])As far as I can see, there's no way for render_doc to store the render
options on the cmark_node document itself. And there's no way for that
same node to call to_htmlβit must be handled by a different
cmark_render_html method.Is that correct? And if so, is that design intentional? I could piece
something together for the Ruby wrapper to work around this, but I
thought it might make sense to apply the change at the C level.β
Reply to this email directly or [2]view it on GitHub.References
from cmark.
That makes sense. I'll change the title to reflect that this might be better fixed by a change in the docs.
from cmark.
Related Issues (20)
- Parser incorrectly reading strong/emph in paragraphs that contain links. HOT 2
- Quadratic behavior in Commonmark renderer involving get_containing_block HOT 1
- Add additional C flags to your build (improving your code) HOT 5
- [Clang-tidy] Narrowing data types is implementation defined
- [Feature] Support math environment via $ and $$ like LaTeX HOT 2
- Line spacing of items in an unordered list is different if an item contains a fenced code block with an blank line before HOT 2
- API documentation is missing an explanation of CMARK_NODE_CUSTOM_BLOCK and CMARK_NODE_CUSTOM_INLINE HOT 2
- incorrect start_column & end_column HOT 1
- Odd parsing of `**A*B*C*` HOT 3
- Tracking backslash escapes?
- Latex export does not set the enumi counter correctly HOT 1
- H
- Parsing of "____a__!__!___" HOT 2
- Parsing of inline HTML declaration is stricter than spec
- Quadratic behavior when scanning inline HTML comments HOT 3
- Link reference definition title that should not be
- `cmark -t commonmark` makes little sense HOT 3
- libcmark uses full version number as major dylib version number HOT 3
- HTML comments do not follow the 0.30 spec
- Make `CMARK_OPT_UNSAFE` settable during runtime HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmark.