Code Monkey home page Code Monkey logo

Comments (3)

simeonwillbanks avatar simeonwillbanks commented on June 21, 2024

@gjtorikian brings up a valid concern.

I wonder what the performance implications would be.

Maybe we add a context option for tags to syntax highlight, and the default option is a pre tag?

Once one or many tags can be searched, benchmarks could be performed.

Thoughts?

from html-pipeline.

gjtorikian avatar gjtorikian commented on June 21, 2024

The more I think about this the harder it becomes. Linguist uses file extensions and text analysis to determine how to highlight a file. A few tokens might not be enough to determine how code should be colored. (This is all just a pessimistic guess, though.)

from html-pipeline.

jch avatar jch commented on June 21, 2024

It's an interesting suggestion, but I'm going to say no to this feature.

When using multi-line fenced code blocks, the user can explicitly specify the language for us to highlight. For inline blocks, we'd have to guess what the language is. There will be lots of ambiguity if it's only a few tokens, and if an inline phrase is used, then it's likely to be short. This would increase the time to render, and give potential bad highlights.

from html-pipeline.

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.