Open christian-schlichtherle opened 10 years ago
This happens when using Velocity, so here is some minimal content to reproduce the issue:
#set($h1 = '##')
$h1 Foo
This is someone's content.
Put this into a file named foo.md.vm
and run
$ mvn site:run
Then display the page in the browser.
Sorry, it hasn't anything to do with Velocity. If you put the following content into a file named foo.md
, then same substitution issue occurs:
## Foo
This is someone's content.
If you remove the ## Foo
heading, then the invalid substitution does not occur. So somehow the heading changes the way the paragraph gets processed.
Hi, thanks for reporting. Unfortunately, I cannot reproduce it on my machine. When I render the foo.md
file, I get nice smart apostrophe ’
symbol rather than the question mark.
However, I see it is output by Markdown processor as unicode symbol, not HTML entity, so maybe there is an issue with encoding? What is the encoding on your generated page, e.g. <meta charset="UTF-8" />
?
If the encoding is different, you could try setting the UTF-8 encoding in your pom.xml
:
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
or as outputEncoding
configuration on maven-site-plugin
.
Does that help? If not, could you provide more details, e.g. a minimal example and the output HTML?
The generated page uses the UTF-8 encoding indeed. Here's the start of generated source code:
<!DOCTYPE html>
<!--
Generated by Apache Maven Doxia at 2014-02-15
Rendered using Maven Reflow Skin 1.0.0 (http://andriusvelykis.github.com/reflow-maven-skin)
-->
<html xml:lang="en" lang="en">
<head>
<meta charset="UTF-8" />
For what it's worth, the substitution only happens with the reflow-maven-skin and only when I run the site:run goal. When I use the site:site goal, then it does not happen, so the generated final site is OK.
I have tried to add
<properties>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
but it didn't change this behavior.
I am using the maven-reflow-skin in my site configuration as indicated in the documentation. For a start, the custom/reflowSkin element of the site.xml is all empty. Now in my start page index.md.vm, all occurrences of the character '\'' get replaced with '?'. This doesn't with my old skin, so I supposed it's a bug.