Fixing indentation stripped (affect diff highlighting)#168
Merged
greg0ire merged 2 commits intodoctrine:0.4.xfrom Oct 21, 2021
Merged
Fixing indentation stripped (affect diff highlighting)#168greg0ire merged 2 commits intodoctrine:0.4.xfrom
greg0ire merged 2 commits intodoctrine:0.4.xfrom
Conversation
weaverryan
commented
Oct 20, 2021
| $rendered = $document->$renderMethod(); | ||
|
|
||
| if ($format === Format::HTML) { | ||
| if ($format === Format::HTML && $useIndenter) { |
Collaborator
Author
There was a problem hiding this comment.
This is the ugliest part of the PR: using the Indenter really made a mess of the HTML - it was removing some line breaks in odd places. Instead of making the HTML file match what the Indenter wanted, I removed it for this test. It makes it clear that we're getting the exact HTML we want.
Collaborator
There was a problem hiding this comment.
Ref gajus/dindent#28 (maybe we can somehow reactive that PR?)
wouterj
approved these changes
Oct 20, 2021
| $rendered = $document->$renderMethod(); | ||
|
|
||
| if ($format === Format::HTML) { | ||
| if ($format === Format::HTML && $useIndenter) { |
Collaborator
There was a problem hiding this comment.
Ref gajus/dindent#28 (maybe we can somehow reactive that PR?)
7b5c648 to
0b44dbc
Compare
0b44dbc to
0875723
Compare
Member
|
Thanks @weaverryan ! |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
This fixes symfony-tools/docs-builder#124
tl;dr. Suppose you have
The code-block indentation is really 4 spaces. But because that first line (
Normal Line) is indented by 6 spaces (2 of which should be part of the code block), theNodeclass currently thinks that the code block is indented by 6 spaces. It then strips the first 6 characters off each line, which strips the+in front of+ Added line.Cheers!