Giter Club home page Giter Club logo

Comments (3)

Savjee avatar Savjee commented on August 28, 2024

Hmm that's a weird issue. OneHighlighter doesn't do anything special when you paste in text. It's basically just a HTML textarea element. Maybe it's because Vim doesn't use CRLF but LF?

from onehighlighter.

maikthulhu avatar maikthulhu commented on August 28, 2024

That doesn't appear to be the case. I converted a file with unix line endings to DOS line endings (using unix2dos) and tried copying from directly within vim, choosing the Python highlighting, and pasting into OneNote. I did this on both the unix and DOS versions of the file but the output was still the same as described in the original issue.

... And as I was writing this I copied a section of python, chose OneHighlighter from the menu bar and left it on auto-detect. I don't know what it's auto-detecting as, but after I pasted it with that highlighting, the newlines were preserved as expected. This appears that it may just be a problem with the Python syntax highlighting, and indeed that is what I use most often.

from onehighlighter.

maikthulhu avatar maikthulhu commented on August 28, 2024

I just came across this issue with the C syntax highlighting as well. The native file I created (in a VM using vim) had CRLF line-endings. When I copied that from the VM, used OneHighlighter, then pasted it into OneNote, it was one huge glob of text with no line-endings. I then used dos2unix on the file (within the VM), copied the contents again, used OneHighlighter, then pasted into OneNote, and I get similar paste behavior as what I described with Python above. If I use unix2dos to convert LF to CRLF again, then go through the motions, the paste ends up being a glob of text again.

Curious behavior. If I get the time I'd love to dig into this and do a PR. Just documenting what I can, for now.

from onehighlighter.

Related Issues (5)

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.