You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2022/10/09 18:19:01 UTC

[maven-doxia] branch DOXIA-671 updated (115e5673 -> fd24f2e0)

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a change to branch DOXIA-671
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git


    omit 115e5673 [DOXIA-671] Double quotes contained in markdown page are removed in HTML output
     add 61000025 [DOXIA-676] Remove all obsolete elements in HTML5 and add new ones
     new fd24f2e0 [DOXIA-671] Double quotes contained in markdown page are removed in HTML output

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (115e5673)
            \
             N -- N -- N   refs/heads/DOXIA-671 (fd24f2e0)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/maven/doxia/markup/HtmlMarkup.java  | 305 ++++++++++-----------
 .../org/apache/maven/doxia/util/HtmlTools.java     |  41 +--
 2 files changed, 163 insertions(+), 183 deletions(-)


[maven-doxia] 01/01: [DOXIA-671] Double quotes contained in markdown page are removed in HTML output

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch DOXIA-671
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git

commit fd24f2e05e61549116a0b979170603b1ca8ccd10
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Oct 2 00:18:38 2022 +0200

    [DOXIA-671] Double quotes contained in markdown page are removed in HTML output
    
    Ideally, one would use this list in the future:
      https://html.spec.whatwg.org/multipage/named-characters.html#named-character-references
    
    This closes #123
---
 .../maven/doxia/parser/AbstractXmlParser.java      | 34 +++++++++++++++++++++-
 1 file changed, 33 insertions(+), 1 deletion(-)

diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
index 1cf38ad6..7adb8d25 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
@@ -44,6 +44,7 @@ import org.apache.maven.doxia.util.XmlValidator;
 
 import org.codehaus.plexus.util.IOUtil;
 import org.codehaus.plexus.util.StringUtils;
+import org.codehaus.plexus.util.xml.pull.EntityReplacementMap;
 import org.codehaus.plexus.util.xml.pull.MXParser;
 import org.codehaus.plexus.util.xml.pull.XmlPullParser;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
@@ -91,6 +92,18 @@ public abstract class AbstractXmlParser
 
     private boolean validate = false;
 
+    /**
+     * If set the parser will be loaded with all single characters
+     * from the XHTML specification.
+     * The entities used:
+     * <ul>
+     * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent</li>
+     * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent</li>
+     * <li>http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent</li>
+     * </ul>
+     */
+    private boolean addDefaultEntities = true;
+
     /** {@inheritDoc} */
     public void parse( Reader source, Sink sink, String reference )
         throws ParseException
@@ -120,7 +133,9 @@ public abstract class AbstractXmlParser
         // 2 second parsing to process
         try
         {
-            XmlPullParser parser = new MXParser();
+            XmlPullParser parser = addDefaultEntities
+                                   ? new MXParser( EntityReplacementMap.defaultEntityReplacementMap )
+                                   : new MXParser();
 
             parser.setInput( src );
 
@@ -569,6 +584,23 @@ public abstract class AbstractXmlParser
         this.validate = validate;
     }
 
+    /**
+     * @since 2.0.0-M4
+     */
+    public boolean getAddDefaultEntities()
+    {
+        return addDefaultEntities;
+    }
+
+    /**
+     * @since 2.0.0-M4
+     */
+    public void setAddDefaultEntities( boolean addDefaultEntities )
+    {
+        this.addDefaultEntities = addDefaultEntities;
+    }
+
+
     // ----------------------------------------------------------------------
     // Private methods
     // ----------------------------------------------------------------------