Giter VIP home page Giter VIP logo

Comments (7)

cebe avatar cebe commented on May 18, 2024

You would add Emoji as an inline element this means it will only be parsed with blocks that allow inline elements. Code blocks are not parsed for inline elements obviously so this should work all as expected.

Add the : marker and implement a parsing function for it and you'll have emoji support working ;)

from markdown.

maximal avatar maximal commented on May 18, 2024

Oh, cool about Emoji.

But modules can be different. Some will need recurse processing in already processed (by other modules/rules) blocks, some won’t.

from markdown.

cebe avatar cebe commented on May 18, 2024

can you give an example?

from markdown.

maximal avatar maximal commented on May 18, 2024

For example, we have typography tools like SmartPants, which replace "these" quotes to “these”.

In some cases we need them to process already processed blocks and inline elements: citation blocks, emphased inlines, hyperlink texts and so on.

In some cases we need them not to process: code blocks, code inlines, auto-hyperlinks (only web address provided).

This is for one module. There can be very many variations when new modules appear.

Ideally, when creating module we can have options defining whether to process which blocks, do processing before or after other processings are done and so on.

from markdown.

cebe avatar cebe commented on May 18, 2024

Looks like you are thinking of this like many other markdown parsers work using regex and processing each element type at a time over the complete text. This library works differently by checking for the next beginning element and parsing it by deciding whether to parse the contents as markdown or not.
This is what inline markers are used for. They mark beginning of an element and the associated parse function will handle everything until the end of the element.

from markdown.

maximal avatar maximal commented on May 18, 2024

Know about modern Parsedown approach.
OK, I’ll try to implement Emojis for this Markdown (as I need ’em in one of my projects) and then probably I’ll be more armed and experienced :-)

This issue is not matter of approach, regexp or parsedown, whatever. It’s more about architecture of modules: where they apply and when.

from markdown.

cebe avatar cebe commented on May 18, 2024

Imo this is solved by adding the parsePlainText() method in 0eac7ba#diff-037865b8555f7db5ac9338cfb5be7466R258

from markdown.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.