-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Expose defaultHandlers
to be reused
#67
Comments
For |
This project is already mapping |
@wooorm I need to find the correct https://github.com/rx-ts/cf2md/blob/main/src/index.ts#L64-L66 And for See also https://github.com/rx-ts/cf2md/blob/main/src/index.ts#L25 |
The same is true in normal HTML:
|
The <pre data-syntaxhighlighter-params="brush:yaml;">text</pre> So I need to wrap it into a |
Right, but I don’t understand why you now have all that extra code in the (I specifically don’t understand why this part is needed: https://github.com/rx-ts/cf2md/blob/980c2f8002744aa25dba50b190d65177c26d591a/src/index.ts#L82-L101) |
The |
You can Do you want to:
If it was named |
I'm, https://github.com/rx-ts/cf2md/blob/980c2f8002744aa25dba50b190d65177c26d591a/src/index.ts#L4 What I want is const h = {
defaultHandlers: handlers,
handlers: Object.assign({}, handlers, options.handlers)
} So that I can access |
This seems similar to But no |
I really don’t understand why all of these lines are needed, instead of
hast-util-to-mdast/lib/index.js Lines 89 to 91 in a02be0e
Fine 👍 |
I've mentioned:
https://github.com/syntax-tree/hast-util-to-mdast/blob/main/lib/handlers/code.js#L39
For most use cases, should it be And it's the user's choice to change |
Or at least we can |
@ChristianMurphy or others: which if the two PRs do y'all prefer? |
Initial checklist
Problem
Maybe a bit similar to syntax-tree/mdast-util-to-markdown#34
I'm trying to implement a tiny util
cf2md
whichTransform from confluence flavored HTML to Markdown with enhanced features.
In confluence's HTML,
pre
can be used withoutcode
inside, so I have to wrap its direct text nodes into acode
node to reuse originalh.handlers.pre
, but there is nodefaultHandlers
provided, so I have to useimport { code } from 'hast-util-to-mdast/lib/handlers/code.js'
which is the originalh.handlers.pre
actually.See also https://github.com/rx-ts/cf2md/blob/main/src/index.ts#L82
Solution
Expose
defaultHandlers
inh
Alternatives
N/A
The text was updated successfully, but these errors were encountered: