Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Michal Grňo
    @m93a
    I solved it by a hack (rewriting parse with (...a)=>{ n=0; return parse(...a); }), but my PR#498 seems like more solid solution to this. Would you please take a look at it? :)
    Vitaly Puzrin
    @puzrin
    If you call parser & renderer manually, you can do a lot of things between. Or you can add rule to core chain. No need to overcomplicate existing interfaces.
    I'd suggest to loook at https://github.com/markdown-it/markdown-it/tree/master/docs for general principles.
    Michal Grňo
    @m93a
    Oh, cool! I didn't know there were docs for extensions! Could you please a add link to this to #10 as it's the first relevant issue I found when searching for "markdown-it extension documentation"?
    Ok, I found out that the link is actually there but you write that it's a draft, that's why I missed it. I think that many people could miss it too, so an comment at the end mentioning that complete specs are on this address would be really cool, thanks!
    Don't understand your words about draft. If you mean issue#10 - it was created by abuser. We don't keep open "endless" issues.
    Sheogorath
    @SISheogorath
    Mhm, just noticed that (c) always becomes a copyright sign. Any way to prevent that? escaping the ( doesn't seem to work
    Julian Lam
    @julianlam
    Indeed
    there's an option called "typographer" or "smartypants", I forget now... you need to disable that
    https://markdown-it.github.io/ (uncheck typographer from the options at the top)
    Vitaly Puzrin
    @puzrin
    see markdown-it/markdown-it#497. IMplementation is a bit dirty, but some workarounds possible, if you don't wish to disable default typographer completely
    Sheogorath
    @SISheogorath
    Oh thanks! Was a bit looking into it and found a hint. looks like my try to fix escaping for it, gets it wrong, but this works, thanks a lot!
    Sheogorath
    @SISheogorath
    MHm seems like my PR doesn't work and I can't figure it out locally .-.
    Ben Parsons
    @benparsons
    is there a way to get a list of broken references after parsing?
    Vitaly Puzrin
    @puzrin
    what is "broken"? Any markdown input is valid.
    Ben Parsons
    @benparsons
    I should say, 'missing' rather than 'broken'
    broken as in 'broken link'
    anyway, I threw together a plugin to do the job, will share code presently
    Luis Belloch
    @luisbelloch
    hello! I'm trying to use profile "zero" with line breaks, but I don't manage to set the breaks option properly... I'd like to ask here before opening an issue, in case there's something wrong with the options I'm setting. Here's an example of the issue https://runkit.com/embed/6umildo238k8
    (markdown-it is awesome btw!)
    Vitaly Puzrin
    @puzrin
    @luisbelloch you should enable back plugins you wish to use. In this case, .enable('newline'). Looks into sources for all available names.
    Luis Belloch
    @luisbelloch
    thanks! I just updated the sample, but it doesn't seem to work... maybe I'm doing something wrong? https://runkit.com/embed/6umildo238k8
    Vitaly Puzrin
    @puzrin
    You enabled plugin, but dropped option { breaks: true }. Return it back.
    Luis Belloch
    @luisbelloch
    awesome, that works!
    markdownIt('zero', { breaks: true }).enable('newline');
    many thanks for the help! :)
    Sourabh Verma
    @sourabhv

    Hi!

    I was following markdown-it-mark to create an extension that can identify ?@?@?@ as a delimiter, so ?@?@?@Foo?@?@?@ would be converted to <quesDelim>Foo</quesDelim>

    The problem is, state.pos starts at position 1 instead of 0. It works fine if I try to use @@@ as a delimiter. It skips ? completely. Also it looks like state.scanDelims scans only for same delimiters as the passed position. Is the ?@?@?@ delim even possible? (it's for internal use so I don't mind if this is against the markdown standard).

    Source with @@@ working: https://gist.github.com/sourabhv/1d7bebc74689c963356b6c330649cb10

    Vitaly Puzrin
    @puzrin
    https://github.com/markdown-it/markdown-it/blob/master/lib/rules_inline/text.js#L16-L38 seems you need to update text rule, to terminate on ?. I can't say right now why it's missed.
    I remembered, that text rules include all chars, which can be used for markup (in theory). Since use ? is bad idea, it's not used. But you can modify it for your needs.
    AT
    @llamamoray
    Hi, I recently created a ticket: markdown-it/markdown-it#518
    I wanted to try and diagnose this locally in the code
    is the easiest way to write a test? or can I run the playground locally?
    AT
    @llamamoray

    I've written this test, but even after upgrading linkify-it it still fails:

    should not terminate on slash underscore
    .
    https://www.riotinto.com/documents/_Iron%20Ore/Port_Handbook_Final_-_July_2016(2).pdf
    .
    <p><a href="https://www.riotinto.com/documents/_Iron%20Ore/Port_Handbook_Final_-_July_2016(2).pdf">https://www.riotinto.com/documents/_Iron%20Ore/Port_Handbook_Final_-_July_2016(2).pdf</a></p>
    .

    Any pointers to where in the library I should start looking into this?

    Daniel Weidner
    @dweidner
    Hi! Could someone help my understand, why String.charCodeAt() is used to search for strings? Is it to avoid encoding issues? I have created a small plugin to improve the generated markup of specific blockquotes and am currently using String.indexOf() to find my markers.
    Vitaly Puzrin
    @puzrin
    Operations with charcodes are usually faster, because more simple types used. But if you don't need to parse 10Mb/sec - don't worry :)
    Daniel Weidner
    @dweidner
    Ah, that was my second thought, that the iteration is more performant
    Thank you for your feedback
    David Luzar
    @dwelle

    Does anyone know of a quick markdown pre-parser that'd split a large document into chunks which can be rendered separately on their own (for perf reasons). I.e., something that's not as naive as splitting on newlines because that'd result in lists/codeBlocks being split midway. Could markdown-it be repurposed to do this?

    The idea is to lazy-render in chunks and render the chunks to DOM continually in separate frames. But also because of using a mark.js lib which takes hundreds of ms to highlight a large DOM tree, so the idea is to split the markdown document into chunks, and then render and highlight each, separately.

    David Luzar
    @dwelle
    I guess I can use markdown-it's parser and figure out what tokens it's safe to split the array on
    Vitaly Puzrin
    @puzrin
    References can be located anywhere. You can't render content right until refs collected. If you don't care about references, you can try to do quick-split: search empty lines + fences start. If fence found - skip lines until fence end.
    David Luzar
    @dwelle
    Yea, I'm thinking of doing a parse of whole doc (in web worker, so perf not an issue).. and splitting the tokens using some heuristic like block: true, level: 0 (if self-closing, else level: -1) or sth like that. Are there gonna be issues with this approach? If I pass same env object to all the split token arrays, there shouldn't be a problem?
    Vitaly Puzrin
    @puzrin
    I don't know. My idea was to collect line numbers, where content between can be independent, and store that separate. Then extract and parse appropriate slices on demand
    David Luzar
    @dwelle
    Forgot to get back in case anyone comes upon this --- the easiest way is to split the token stream on { level: 0, nesting: -1 } (nesting 0 pretty much happens only for hr so let's disregard it). WTBS, this approach works only if the document isn't one (or a few) huge level-0 elem, such as a list or codeBlock - in which case we'd need to split those big blocks up. Anyway, I ended up not doing this at all, so I'm not aware if this approach has any unintended consequences. Thanks @puzrin for your time.
    martijnn
    @martijnn
    Hi, quick question:
    Why is it that the bottom 4 examples don't get parsed properly in this example?
    Donny Yan
    @yanwenjun98
    Hello
    AlexanderSergan
    @AlexanderSergan
    Greetings! Firstly, thanks for maintaining such cool repo.
    Recently I encountered an issues with defining strong and em marks in different places of word:
    e.g. whole word renders correctly but partially it do not work. markdownIt demo
    Also, commonmark official demo renders this text differently: commonmark demo
    Is it a bug or desired behavior of implementation? Thanks
    Augusto Gonzalez
    @4uGuSt0o_twitter
    Hello
    I want to know how to remove rules from markdown-it
    AlexanderSergan
    @AlexanderSergan
    Hi, @4uGuSt0o_twitter! You can have a look at README.md: manage rules
    Augusto Gonzalez
    @4uGuSt0o_twitter
    Hello group