We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given these HTML:
<!-- BELOW IS A HEADING --> <h1>Heading</h1> <!-- BELOW IS A PARAGRAPH --> <p>Paragraph</p>
<h1>Heading</h1> <!-- ABOVE IS A HEADING --> <p>Paragraph</p> <!-- ABOVE IS A PARAGRAPH -->
<h1>Heading</h1> <!-- INBETWEEN --> <p>Paragraph</p>
The conversion will attempt to place the comment close to it's original siblings, like:
<!-- THIS IS A HEADING --> # Heading <!-- THIS IS A PARAGRAPH --> Paragraph
# Heading <!-- ABOVE IS A HEADING --> Paragraph <!-- ABOVE IS A PARAGRAPH -->
# Heading <!-- INBETWEEN --> Paragraph
If the comment in the HTML has no blank-lines between it and BOTH its sibling elements, like:
<h1>Heading</h1> <!-- NO BLANK LINES ON BOTH SIDES --> <p>Paragraph</p>
then a blank-line will be added on both sides:
# Heading <!-- NO BLANK LINES ON BOTH SIDES --> Paragraph
In cases where theres more than 1 blank-line between the comment and its sibling elements:
<h1>Heading</h1> <!-- 3 BLANKS ABOVE, 2 BLANKS BELOW --> <p>Paragraph</p>
Then the blank-lines are preserved:
# Heading <!-- 3 BLANKS ABOVE, 2 BLANKS BELOW --> Paragraph
<h1> <!-- COMMENT BEFORE --> Heading <!-- COMMENT AFTER --> </h1>
# <!-- COMMENT BEFORE -->Heading<!-- COMMENT AFTER -->
<p> <!-- COMMENT BEFORE --> Paragraph <!-- COMMENT AFTER --> </p>
<!-- COMMENT BEFORE --> Paragraph <!-- COMMENT AFTER -->
<ul> <!-- OUTSIDE LIST-ITEM (BEFORE) --> <li>Item 1</li> <li> <!-- INSIDE LIST ITEM (BEFORE) --> Item 2 <!-- INSIDE LIST ITEM (AFTER) --> </li> <li>Item 3</li> <!-- OUTSIDE LIST-ITEM (AFTER) --> </ul>
<!-- OUTSIDE LIST-ITEM (BEFORE) --> - Item 1 - <!-- INSIDE LIST ITEM (BEFORE) --> Item 2 <!-- INSIDE LIST ITEM (AFTER) --> - Item 3 <!-- OUTSIDE LIST-ITEM (AFTER) -->
Cases to add to issue's description:
<a>
<h1 <!-- COMMENT--> >
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Basic idea
Given these HTML:
The conversion will attempt to place the comment close to it's original siblings, like:
# Heading <!-- INBETWEEN --> Paragraph
No blank-lines on both sides
If the comment in the HTML has no blank-lines between it and BOTH its sibling elements, like:
then a blank-line will be added on both sides:
# Heading <!-- NO BLANK LINES ON BOTH SIDES --> Paragraph
Multiple blank-lines
In cases where theres more than 1 blank-line between the comment and its sibling elements:
Then the blank-lines are preserved:
# Heading <!-- 3 BLANKS ABOVE, 2 BLANKS BELOW --> Paragraph
Comments inside elements
Heading
Paragraph
List
Cases to add to issue's description:
<a>
)(ie. bold, italics, code, strikethrough, sub/superscript, underline)
(eg.
<h1 <!-- COMMENT--> >
)The text was updated successfully, but these errors were encountered: