最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

How can I style individual table cells for Markdown to HTML conversion using Pandoc? - Stack Overflow

matteradmin5PV0评论

In Markdown I have tables like in the following example:

|             | Fruit | Vegetable |
|-------------|-------|-----------|
| Apple       | yes   | no        |
| Broccoli    | no    | yes       |
| Carrot      | no    | yes       |
| Orange      | yes   | no        |
| Tomato      | (yes) | yes       |

Now I would like to highlight the "Tomato-Fruit" cell with some background color when converting the Markdown file to HTML using Pandoc.

I tried adding some cell attribute like this:

| Tomato      | {: .emph} (yes) | yes |

and used the following command for conversion

pandoc -f markdown+markdown_attribute -t html -o output.html input.md

but the HTML output contains the {: .emph} string literally, instead of being transformed into an HTML element class attribute (tested with Pandoc version 3.1.3).

Is there a way to style individual cells in Markdown as parsed by Pandoc?

Post a comment

comment list (0)

  1. No comments so far