- Notifications
You must be signed in to change notification settings - Fork 84
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
It seems to me there is a fairly big difference in how the Python port handles MarkdownIt.__init__ parameters compared to the JS implementation, that isn't documented in port.yaml. Two major differences that I see:
- A setting mapping in JS init is
options. In Python implementation the mapping is a similar structure that JS passes to.configure(), that is it is the "preset" structure that containsoptionsandcomponents. - When passed in
options, Javascript always merges the options with a set of preset values. In Python, passing in a settings dict will skip using any preset values at all.
As a result, in Javascript I can do the following to get "default" presets and make a change in one setting:
var md = markdownit({ html: false });In Python the same would be more like:
from markdown_it import presets conf = presets.default.make() conf["options"]["html"] = False md = MarkdownIt(conf)Is this difference in the API intended? If yes, should we document it in port.yaml? If no, maybe we should redesign the init function before v1.0.0?
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request