Code Monkey home page Code Monkey logo

Comments (6)

MikeMcQuaid avatar MikeMcQuaid commented on July 19, 2024

I can't find an official description but the original intent was to provide this additional feature that GitHub Flavoured Markdown provides:

Escape Underscores in Words

It is not reasonable to italicize just part of a word, therefore words containing multiple underscores have their inner underscores escaped. This foo_bar_baz does not turn into foobarbaz.

https://www.drupal.org/project/gfm

from github-markdown.tmbundle.

noniq avatar noniq commented on July 19, 2024

Makes sense. But it seems that TextMate's own Markdown grammar already handles this (see second screenshot)?

from github-markdown.tmbundle.

MikeMcQuaid avatar MikeMcQuaid commented on July 19, 2024

@noniq Yes, you are correct. 👍 to tearing out the new buggy, italic stuff from me.

from github-markdown.tmbundle.

noniq avatar noniq commented on July 19, 2024

Hm okay, not sure what exactly I did wrong, but TextMate’s own Markdown grammar does indeed italicize part of words. So it is still necessary to somehow override this feature in this bundle.

I’m right now experimenting a bit, the following seems to work fine:
bildschirmfoto 2017-04-28 um 17 53 30

I simplified the look-behind pattern to make sure the rule also matches the first underscore in a word. I also changed the injection selector to (L:text.html.markdown) (removing the markup.italic.markdown part). Finally, I changed name to markup.other to prevent the matched underscores from getting italicized (which does not make a different in any font I know of, but who knows …)

I’ve checked with a few Markdown documents, and they all seem to be highlighted correctly. But I’m totally sure that there could be some edge cases where something breaks. Any ideas what else to check or improve?

from github-markdown.tmbundle.

MikeMcQuaid avatar MikeMcQuaid commented on July 19, 2024

I’ve checked with a few Markdown documents, and they all seem to be highlighted correctly. But I’m totally sure that there could be some edge cases where something breaks. Any ideas what else to check or improve?

Seems great to me; definitely better than what's there currently!

from github-markdown.tmbundle.

noniq avatar noniq commented on July 19, 2024

I merged this for now. I’ll keep an eye on it and refine if necessary.

from github-markdown.tmbundle.

Related Issues (15)

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.