Comments (3)
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onehighlighter.