-
Is it possible to use remark-gfm but disable autolinking? What I'm seeing I want to use GFM, but mostly for tables and maybe strikethrough. I don't mind checkboxes one way or the other. Autolinking would be fine, but I find that it links a lot of things that I don't intend to be links (and that GitHub doesn't link either--so maybe this is a bug?). So, if I have a GFM table with the columns not aligned, remark-gfm aligns them if I parse and then stringify. Great. But if I have something like this: Here's how GitHub renders it: (Specifically, it does not turn the text into a link.) But if I parse and stringify that text with remark-gfm.... echo '* [email protected]' | remark -u remark-gfm
* <[email protected]>
<stdin>: no issues found It surrounds it in It's possible I'm misunderstanding parse and stringify. I'm hoping to use So options I've considered:
Thanks for taking the time to read and for providing this robust ecosystem for people like me to use for free. ❤️ |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I'm not sure if it's the right/complete solution, but syntax-tree/mdast-util-gfm-autolink-literal#5 seems to fix this issue and doesn't break any existing tests, so hopefully it's on the right track at least? |
Beta Was this translation helpful? Give feedback.
-
You could do what
These are indeed bugs! I’ve spent a lot of time trying to reverse engineer what GitHub does. But it’s hard because it’s not specified and because they use different algorithms in different places.
Yep, that’s what it’s supposed to do. And indeed a bug.
I want to do this! |
Beta Was this translation helpful? Give feedback.
You could do what
remark-gfm
does — add micromark and mdast-util-{to,from} extensions/utilities — but withoutmicromark-extension-gfm-autolink-literal
andmdast-util-gfm-autolink-literal
.These are indeed bugs! I’ve spent a lot of time trying to reverse engineer what GitHub does. But it’s hard because it’s not specified and because they use different algorithms in different places.
I’d appreciate hearing about all the cases where our algorithm doesn’t match theirs.