GithubHelp home page GithubHelp logo

Comments (7)

Kage avatar Kage commented on August 22, 2024

Do you mean updating Highlight.js? Or are you proposing something else?

from cryptopaste.

Kage avatar Kage commented on August 22, 2024

@anshuman73 Ping, can you update please?

from cryptopaste.

anshuman73 avatar anshuman73 commented on August 22, 2024

Hi, sorry for the delayed response.
I was suggesting setting Syntax highlighting for languages while the text is being entered.

currently, the viewer chooses the language to highlight the syntax for, wouldn't it be better if the paster can set the syntax too and the viewer gets that syntax highlighting automatically ?

from cryptopaste.

anshuman73 avatar anshuman73 commented on August 22, 2024

A potential way could be to store the language in the crypt, but (with my limited cryptographic knowledge), I believe it would make the crypt insecure.

from cryptopaste.

Kage avatar Kage commented on August 22, 2024

I had thought about some method of storing a language pre-set (e.g. injecting a language marker into the paste before being encrypted), but I decided not to namely since I wasn't sure how to do the whole thing well.

I don't know of a good way to take Highlight.js and apply it to a rich text editor. If you have some idea, I'd be delighted to review a pull request.

from cryptopaste.

Kage avatar Kage commented on August 22, 2024

After looking around, it appears CodeMirror would be the best option here. It would need to make sure to invoke the cmObj.toTextArea() function before doing the in-browser encryption. Also needs to provide a selection for languages (listed from CodeMirror.modes object), then I believe use cmObj.setOption('mode', '<language>') to change them.

from cryptopaste.

rexus3512 avatar rexus3512 commented on August 22, 2024

Hi, if you want to put add-on like code beautifier you can find libraries on the internet and integrate it

from cryptopaste.

Kage avatar Kage commented on August 22, 2024

@adrivanrex You're more than welcome to submit a pull request with that or any suitable syntax highlighting library added.

from cryptopaste.

rexus3512 avatar rexus3512 commented on August 22, 2024

trapizoid

from cryptopaste.

rexus3512 avatar rexus3512 commented on August 22, 2024

Unlock

from cryptopaste.

Related Issues (14)

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.