简体   繁体   中英

Display a dollar sign inside a code span using maven site and markdown

I would like to display a dollar sign inside a code span generated with maven-site-plugin and markdown (doxia-module-markdown).

Out of a code span, I used the numerical code $ and it fixed the issue. But inside a code span (4 spaces), the numerical code is not decoded, which is actually not suprising :

Within a code block, ampersands (&) and angle brackets (< and >) are automatically converted into HTML entities.

(from http://daringfireball.net/projects/markdown/syntax#code )

I also tried to double the dollar sign ( $$ ), escape it ( \\$ ), charm it ( <3$ ), but nothing worked!

Does someone have any idea?

You can use a raw dollar sign within a code block. There is even a small example of this in the doxia syntax page :

Blockquotes can contain other Markdown elements, including headers, lists, and code blocks:

> ## This is a header.  
>   
> 1.   This is the first list item.  
> 2.   This is the second list item.  
>   
> Here's some example code:  
>   
>     return shell_exec("echo $input | $markdown_script");

In the example above, the dollars are unescaped.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM