Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve comments #2

Closed
infotexture opened this issue Nov 13, 2019 · 2 comments · Fixed by #6
Closed

Preserve comments #2

infotexture opened this issue Nov 13, 2019 · 2 comments · Fixed by #6

Comments

@infotexture
Copy link
Contributor

This plug-in currently strips all comments from XML files, but many projects use comments for licensing statements, documentation, or other mandatory information that must be preserved.

If the project prefers to remove comments by default, at least consider adding a configuration option that would allow users to preserve comments if necessary.

@kddnewton
Copy link
Member

@infotexture definitely should! Could you potentially post a test case here? (An XML file with lots of comments would be ideal.)

@infotexture
Copy link
Contributor Author

@kddeisz I don't have an extensively-commented file handy at the moment, but here's a simple example from a real project:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<!--  This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license.  -->

<map>
  <title>Installing</title>

  <topicref keyref="prerequisite-software"/>
  <topicref keyref="determining-version-of-ditaot"/>
  <!-- ↓ branch-filter ↓ -->
  <topicref href="using-dita-command.dita"
            keys="first-build-using-dita-command" locktitle="yes">
    <topicmeta>
      <navtitle>Building output</navtitle>
    </topicmeta>
    <ditavalref href="../resources/novice.ditaval">
      <ditavalmeta>
        <dvrResourcePrefix>first-build-</dvrResourcePrefix>
      </ditavalmeta>
    </ditavalref>
  </topicref>
  <!-- ↑ end-filtering ↑ -->
  <topicref keyref="installing-via-homebrew"/>
</map>

In this case, the second and third comments are used to mark a section of the file that is included by reference elsewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants