Comments (7)
You are right about the pygments thing. I'll take a look.
from anki-code-highlighter.
Could you provide the field's HTML code and the card template code as instructed in the template?
from anki-code-highlighter.
Sorry. I updated the comment including the needed information.
from anki-code-highlighter.
This highlighting is not from this plugin, which uses solarized night. What is this a picture of?
Here's how the rendered card looks like on my PC using the settings you have provided:
Could you provide the following:
- Screenshots of the editor window with the misbehaving card together with the HTML editor open.
- Screenshots of the rendered card.
- In reproduction steps, provide the text block you want me to copy to reproduce this.
Use fenced code blocks for pasting code with newlines.
You could also just try removing text-align: center;
or changing it to text-align: left
in your styling. Might help.
I suspect this text-align: center
and not using unformatted pastes for copied HTML-trees from VS-code are the culprits.
from anki-code-highlighter.
What is this a picture of?
I used your instructions to use custom styles. I'm using the Dracula theme, hence the different colors.
Could you provide the following:
1. Screenshots of the editor window with the misbehaving card together with the HTML editor open.
Before applying syntax highlighting:
After applying syntax highlighting (highlight.js):
2. Screenshots of the rendered card.
3. In reproduction steps, provide the text block you want me to copy to reproduce this.
I copied this from VSCode:
<head>
<meta charset="utf-8">
<title>Styles Conference</title>
<link rel="stylesheet" href="assets/stylesheets/main.css">
</head>
You could also just try removing text-align: center; or changing it to text-align: left in your styling. Might help.
That indeed aligns the block to the left but the indenting is missing (just like your screenshot).
I suspect this
text-align: center
and not using unformatted pastes for copied HTML-trees from VS-code are the culprits.
Well, I used to copy from VSCode and paste (Ctrl + Shift + V) to Anki and it rendered ok, ie, with the code
tag. Now, if I paste, the style is inherited from the default card, I guess. That's why I wrote that I had to remove some tags in the editor. This message appears if I don't do that:
from anki-code-highlighter.
That indeed aligns the block to the left but the indenting is missing (just like your screenshot).
That are no indents in the HTML code itself, so it's hard to expect indents in the render. Once you add indenting whitespace, you should get your expected result.
from anki-code-highlighter.
I'm dumb! Yes, I had to manually add the spaces. Sorry, I thought that the addon did the formatting stuff. But if I use pygments it shows the HTML entities instead of the symbols...
from anki-code-highlighter.
Related Issues (20)
- Don't add a spurious newline
- How to build from source? HOT 1
- Text alignment issue with Pygments Block formatting HOT 3
- Request for Instructions on Customizing Pygments Styles HOT 4
- Update Pygments HOT 1
- Update to highlight.js 11.8
- Error on decks HOT 6
- Failed to load Addon uppon Starting Anki HOT 1
- Adding additional highlighting/styling with highlight.js HOT 3
- Update Broke compatibility with `Addon-anki-enhanced-cloze` HOT 9
- Code-Highlighter not working. (https://github.com/RisingOrange/anki-enhanced-cloze got updated ) HOT 2
- Change font family HOT 2
- I can't set the default highlighter. HOT 2
- Anki error on startup with Anki theme HOT 2
- Error when running generate-pygments-css HOT 3
- No colors in the default styles HOT 6
- bug: Code Block - Selection Highlight Error HOT 2
- HTML Angular support HOT 3
- Highlight code from clipboard HOT 2
- Is there a way to have unhighlighted <pre><code> blocks? HOT 3
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 anki-code-highlighter.