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

Michael Osipov commented on MSITE-1002:
---------------------------------------

Let's slow down here a bit and analyze what is first produced and what is then 
perfomed by the skin because these are two distinct issues.
What produces Doxia?
{code:java}
    public void verbatim(SinkEventAttributes attributes) {
        if (paragraphFlag) {
            // The content of element type "p" must match
            // 
"(a|br|span|bdo|object|applet|img|map|iframe|tt|i|b|u|s|strike|big|small|font|basefont|em|strong|
            // 
dfn|code|q|samp|kbd|var|cite|abbr|acronym|sub|sup|input|select|textarea|label|button|ins|del|script)".
            paragraph_();
        }

        verbatimFlag = true;

        MutableAttributeSet atts = SinkUtils.filterAttributes(attributes, 
SinkUtils.SINK_VERBATIM_ATTRIBUTES);

        if (atts == null) {
            atts = new SinkEventAttributeSet();
        }

        boolean source = false;

        if (atts.isDefined(SinkEventAttributes.DECORATION)) {
            source = "source"
                    
.equals(atts.getAttribute(SinkEventAttributes.DECORATION).toString());
        }

        SinkEventAttributes divAtts = null;
        String divClass = "verbatim";

        if (source) {
            divClass += " source";
        }

        divAtts = new 
SinkEventAttributeSet(SinkEventAttributes.CLASS.toString(), divClass);

        atts.removeAttribute(SinkEventAttributes.DECORATION);

        writeStartTag(HtmlMarkup.DIV, divAtts);
        writeStartTag(HtmlMarkup.PRE, atts);
    }
{code}
There is a regular verbatim with {{pre}} and one attributed with source to make 
a distinction for source code. Both Xdoc and APT have the difference as well: 
verbatim (fixed length) and source code. If we want to change that to 
{{<code>}} instead of {{<pre>}} for source code we need to change/fix/adapt 
Doxia.
What does the Fluido Skin?
{code}
replaceAll( '<div class="verbatim source">(\r?\n)?<pre>', '<div class="verbatim 
source"><pre class="' + $sourceStyle + '">' )
{code}
Exactly replacing that what the skin and pre prettifier expect.

If Markdown, as it obviously is, produces a different output that is a problem 
with the Markdown sink we need to take care of. The actual skin should not know 
anything about the source format, IMHO.

> Maven Site 4 will break code highlight of site generated by Markdown
> --------------------------------------------------------------------
>
>                 Key: MSITE-1002
>                 URL: https://issues.apache.org/jira/browse/MSITE-1002
>             Project: Maven Site Plugin
>          Issue Type: Bug
>          Components: doxia integration
>    Affects Versions: 4.0.0-M13
>            Reporter: Xavi Lee
>            Assignee: Konrad Windszus
>            Priority: Major
>         Attachments: maven-site-3.png, maven-site-4.png, test-v3.html, 
> test-v4.html
>
>
> repro repo https://github.com/awxiaoxian2020/code-render-bug
> master branch is Maven Site 3 with Fluido skin 1
> v4 branch is Maven Site 4 with Fluido skin 2.
> Open their respective `target/site/test.html` files in local to see the 
> rendered result.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to