You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2022/02/06 11:41:00 UTC

[jira] [Comment Edited] (DOXIA-536) AptParser does not force linebreak in Sink after a comment is written

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

Michael Osipov edited comment on DOXIA-536 at 2/6/22, 11:40 AM:
----------------------------------------------------------------

[~hboutemy], I have checked source code again. There is no way in Doxia to tell that in some markup languages comments are line oriented, i.e, after a comment the terminator is {{EOL}}. I cannot also call {{setVerbatimFlag(boolean}}} on XML-based sinks because it is protected.

We have two options:
1. Extend the Sink API to support line-oriented comments
2. Ignore this and close it out.

WDYT?


was (Author: michael-o):
[~hboutemy], I have checked source code again. There is no way in Doxia to tell that in some markup languages comments are line oriented, i.e, after a comment the terminator is {{EOL}}. I cannot also call {{setVerbatimFlag(boolean}}} on XML-based sinks because it is protected.
We have two options:
1. Extend the Sink API to support line-oriented comments
2. Ignore this and close it out.

> AptParser does not force linebreak in Sink after a comment is written
> ---------------------------------------------------------------------
>
>                 Key: DOXIA-536
>                 URL: https://issues.apache.org/jira/browse/DOXIA-536
>             Project: Maven Doxia
>          Issue Type: Bug
>          Components: Module - Apt
>    Affects Versions: 1.6
>            Reporter: Michael Osipov
>            Priority: Minor
>              Labels: intern
>             Fix For: wontfix-candidate
>
>
> Consider this comment block:
> {noformat}
> ~~ Copyright 2012 Michael Osipov
> ~~
> ~~ Licensed under the Apache License, Version 2.0 (the "License");
> ~~ you may not use this file except in compliance with the License.
> ~~ You may obtain a copy of the License at
> ~~
> ~~     http://www.apache.org/licenses/LICENSE-2.0
> ~~
> ~~ Unless required by applicable law or agreed to in writing, software
> ~~ distributed under the License is distributed on an "AS IS" BASIS,
> ~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
> ~~ See the License for the specific language governing permissions and
> ~~ limitations under the License.
> {noformat}
> Apt's comment syntax goes to the end of the line which would mean that if the {{AptParser}} hits a comment it has to create a line break with the target {{Sink}} too. Unfortunately, the result in, e.g., HTML is:
> {noformat}
> <!-- Copyright 2012 Michael Osipov --><!--  --><!-- Licensed under the Apache License, Version 2.0 (the "License"); --><!-- you may not use this file except in compliance with the License. --><!-- You may obtain a copy of the License at --><!--  --><!-- http://www.apache.org/licenses/LICENSE-2.0 --><!--  --><!-- Unless required by applicable law or agreed to in writing, software --><!-- distributed under the License is distributed on an "AS IS" BASIS, --><!-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --><!-- See the License for the specific language governing permissions and --><!-- limitations under the License. -->
> {noformat}
> This is ugly doesn't make the comment readible at all. Investigate how we can send a {{line.separator}}, i.e., pretty-print the output.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)