You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/01/03 00:07:00 UTC

[jira] [Commented] (DOXIA-542) Markdown module converts all apostrophes to quotation marks

    [ https://issues.apache.org/jira/browse/DOXIA-542?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17257614#comment-17257614 ] 

ASF GitHub Bot commented on DOXIA-542:
--------------------------------------

bertysentry opened a new pull request #50:
URL: https://github.com/apache/maven-doxia/pull/50


   This PR solves [DOXIA-542](https://issues.apache.org/jira/browse/DOXIA-542) by disabling the replacement of "single" apostrophes with stylized quotes.
   
   `This isn't a quote` will keep the good old apostrophe.
   `This is 'a quote'` will change the apostrophes to opening and closing quotes.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Markdown module converts all apostrophes to quotation marks
> -----------------------------------------------------------
>
>                 Key: DOXIA-542
>                 URL: https://issues.apache.org/jira/browse/DOXIA-542
>             Project: Maven Doxia
>          Issue Type: Bug
>          Components: Module - Markdown
>    Affects Versions: 1.4, 1.7
>            Reporter: Wolfgang Illmeyer
>            Priority: Major
>
> Whenever there is some text in a markdown file containing an apostrophe (U+0027, e.g. »don't«), it is seemingly unconditionally replaced by a »right single quotation mark« (U+2019).
> The problem seems to be an out-of-whack »smart« feature of the underlying pegdown library, which is supposed to perform all kinds of typographic black magic. I'd suggest disabling that (or at least make it configurable), because apostrophes are not quotation marks and modern keyboard layouts have all the fancy typographic characters such as different length dashes, ellipses, and all sorts of quotation marks already easily available.
> The fix is relatively trivial:
> {code}
> --- a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java
> +++ b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java
> @@ -70,7 +70,7 @@ public class MarkdownParser
>       * The {@link PegDownProcessor} used to convert Pegdown documents to HTML.
>       */
>      protected static final PegDownProcessor PEGDOWN_PROCESSOR =
> -        new PegDownProcessor( Extensions.ALL & ~Extensions.HARDWRAPS, Long.MAX_VALUE );
> +        new PegDownProcessor( Extensions.ALL & ~Extensions.HARDWRAPS & ~Extensions.SMARTYPANTS, Long.MAX_VALUE );
>  
>      /**
>       * Regex that identifies a multimarkdown-style metadata section at the start of the document
> {code}
> But this makes some tests fail and I didn't have the time to figure out how to fix them.
> Also, the resulting apostrophes probably need to be escaped in the HTML.
> I tested the patch with 1.7.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)