Line and code aren't aligned
See original GitHub issueI copied the code exactly as shown in the example, but adding lineNumbers option breaks the view:
From code inspection, I noticed that the lineNumbers option adds a <div>
which comes before the <pre>
block.
I played with the styling a bit and adding position: absolute;
to the <div>
and some padding to the <pre>
solved it.
I can do it in my css file (unless it is scoped), thought it’d be better if you could check what is the problem with what I experience 😃
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Markdown line break position 【Not aligned】 #66808 - GitHub
VSCode Version: 1.30.2 OS Version: MacOS Steps to Reproduce: As you can see, the position of the newline in VSCode is the beginning...
Read more >Lines of text not aligned with line numbers
But starting on page 4 the lines of text seem to drop down so they no longer align with the numbers. I can...
Read more >(Formatting) New line-alignment within parentheses not ...
When having the option Text Editor/C++/Formatting/Indentation/“Within parentheses, align new lines when I type them” set to “Align contents to opening ...
Read more >Text lines are not aligned when using lstlisting - TeX
When listings breaks a line that is too long, it inserts some space at the beginning of the new line(s). You can remove...
Read more >Why Aligning Statements Will Haunt You | by Fagner Brack
Aligning code can look like an irrelevant code style opinion for an unsuspecting observer. However, it can hide important information and therefore need...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
At first I only imported the
import PrismEditor from "vue-prism-editor"
locally in the component. Now I moved it to themain.js
file with adding the css and it works. Thanks! and cool tool 😃You can use it in your components too. Just include the css and you’re good to go ^^