You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Jotschi (via GitHub)" <gi...@apache.org> on 2023/03/30 09:33:56 UTC

[GitHub] [maven-doxia] Jotschi opened a new pull request, #161: Fix snippet reader tab and indent handling

Jotschi opened a new pull request, #161:
URL: https://github.com/apache/maven-doxia/pull/161

   The PR addresses the following issues:
   
   * The snippet reader did not correctly apply the indentation for snippet sources which were indented using tabs. The minIndent calculation only checked spaces.
   
   Snippet Source:
   ```
   [tab][tab]line
   ```
   
   Old Behaviour
   ```
   [tab][tab]line
   ```
   
   New Behaviour:
   ```
   line
   ```
   
   
   * The snippet reader minIndent calculation was always 0 whenever the snippet contained empty newlines. Those empty lines will now correctly be handled.
   
   Snippet Source:
   ```
   [space][space]line1
   [\n]
   [space]line2
   ```
   
   Old Behaviour
   ```
   [space][space]line1
   [\n]
   [space]line2
   ```
   
   New Behaviour:
   ```
   line1
   [\n]
   [space]line2
   ```
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "Jotschi (via GitHub)" <gi...@apache.org>.
Jotschi commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753562919

   The tabs from this example 
   ```[tab][tab]line```
   will not be removed. Thus the snippet looks ugly. The tabs should be removed.
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "Jotschi (via GitHub)" <gi...@apache.org>.
Jotschi commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753538027

   It fixes the indentation behaviour when the source contains tabs. Without the fix the indentation is not correctly handled. Without the fix the source code block has too many tabs and is not rendered in a nice format.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "Jotschi (via GitHub)" <gi...@apache.org>.
Jotschi commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753603833

   The code clearly removes this indentation if it is done by using spaces. Using tabs it is not removed and thus looks broken.
   I'm okay with it if that is the desired behaviour.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "Jotschi (via GitHub)" <gi...@apache.org>.
Jotschi commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753582952

   The snippet renderer removed unnecessary indentation. It thus moved the code block left. A code example which is highly indented will thus not include the bogus indentation.
   
   ```java
   {
        {
   snipped-start
                { 
                       // your code 
                }
   snipped-end
         }
   }
   ```
   
   should result in
   
   ```java
   { 
         // your code 
   }
   ```
   
   and not
   
   ```java
                { 
                       // your code 
                }
   ```
   
   
   
   


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753613903

   > I think the indentation is clearly removed in order to prevent horizontal scrollbars for included snippets.
   
   I'd prefer to leave formatting as-is, but I am open to a snippet option which reverse-indents.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753593496

   But what if
   ```
                { 
                       // your code 
                }
   ```
   is correct indentation?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753541119

   > It fixes the indentation behaviour when the source contains tabs. Without the fix the indentation is not correctly handled. Without the fix the source code block has too many tabs and is not rendered in a nice format.
   
   But looking at your examples it does remove tabs as well, no?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "Jotschi (via GitHub)" <gi...@apache.org>.
Jotschi commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753545065

   As far as I recall - no - tabs are not removed at all. See first example.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753573765

   @kwin, do you understand this PR?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753607241

   > The code clearly removes this indentation if it is done by using spaces. Using tabs it is not removed and thus looks broken. I'm okay with it if that is the desired behaviour.
   
   It is hard to say what is right, but I would say that a snippet should remain as-is and not modified, as ugly as it is.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "Jotschi (via GitHub)" <gi...@apache.org>.
Jotschi commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753609381

   I think the indentation is clearly removed in order to prevent horizontal scrollbars for included snippets.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1761042561

   I'd like to perform a release this weekend. Anyone want to complete the discussion with me?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753520298

   I don't understand this change. It does not retain the original format, what does it address?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753573193

   > The tabs from this example `[tab][tab]line` will not be removed. Thus the snippet looks ugly. The tabs should be removed.
   
   Why? If the snippet is intended that way?  How can we know what is right or wrong in snippet content and context?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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


Re: [PR] Fix snippet reader tab and indent handling [maven-doxia]

Posted by "michael-o (via GitHub)" <gi...@apache.org>.
michael-o commented on PR #161:
URL: https://github.com/apache/maven-doxia/pull/161#issuecomment-1753550682

   First snippet has two tabs, but expected does not have any. What do I miss?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

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