Giter VIP home page Giter VIP logo

Comments (7)

gregorias avatar gregorias commented on June 10, 2024 1

You are right about the pygments thing. I'll take a look.

from anki-code-highlighter.

gregorias avatar gregorias commented on June 10, 2024

Could you provide the field's HTML code and the card template code as instructed in the template?

from anki-code-highlighter.

DallasBelt avatar DallasBelt commented on June 10, 2024

Sorry. I updated the comment including the needed information.

from anki-code-highlighter.

gregorias avatar gregorias commented on June 10, 2024

image

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:

image

Could you provide the following:

  1. Screenshots of the editor window with the misbehaving card together with the HTML editor open.
  2. Screenshots of the rendered card.
  3. 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.

DallasBelt avatar DallasBelt commented on June 10, 2024

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:
image

After applying syntax highlighting (highlight.js):
image

2. Screenshots of the rendered card.

image

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:
image

from anki-code-highlighter.

gregorias avatar gregorias commented on June 10, 2024

That indeed aligns the block to the left but the indenting is missing (just like your screenshot).

image

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.

DallasBelt avatar DallasBelt commented on June 10, 2024

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)

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.