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

Formatted code using EditorConfig #508

Closed
wants to merge 2 commits into from

Conversation

josteinaj
Copy link
Member

Follow-up from #507.

</xsl:text>
</xsl:text>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Presumably this is not the same as before. The old code inserts a newline and no spaces. The new code inserts a newline and some spaces.

I tried the test suite and it passes. Are these additional spaces harmless?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. It seems harmless, but the intention is to only insert a newline, so we should fix this. Maybe we could add a xml:space="preserve" on the xsl:text if EditorConfig respects that. Alternatively we could say <xsl:text>&#x0A;</xsl:text> or <xsl:value-of select="'\n'"/>or similar.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a xml:space="preserve" on the xsl:text if EditorConfig respects that

I doubt EditorConfig is that smart :-)

Alternatively we could say <xsl:text>&#x0A;</xsl:text>

That seems like the most straight forward solution

Copy link
Collaborator

@egli egli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, except for the comment about the additional spaces after the newline inside xsl:text

@@ -44,7 +44,7 @@
public static void main(String[] args) {
...
}
</code></p>
</code></p>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same newline issue here, we could maybe try either xml:space="preserve" on the <code> or }&#x0A;</code>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

Copy link
Member Author

@josteinaj josteinaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added "newline issue here" to lines where I could spot a newline issue similar to the one @egli pointed out.

@@ -510,7 +510,7 @@
public static void main(String[] args) {
...
}
</code></p>
</code></p>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

</xsl:text>
</xsl:text>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

@@ -54,23 +54,23 @@
</xsl:if>
</head>
<xsl:text>
</xsl:text>
</xsl:text>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

</html>
<xsl:text>
</xsl:text>
</xsl:text>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

</body>
<xsl:text>
</xsl:text>
</xsl:text>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

<xsl:apply-templates select="$body/*"/>
<xsl:text>
</xsl:text>
</xsl:text>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

<body>
<xsl:apply-templates select="$body/(@* except @xml:base)"/>
<xsl:if test="$body[self::header]">
<xsl:attribute name="epub:type" select="string-join(('frontmatter','titlepage',tokenize($body/@epub:type,'\s+')),' ')"/>
</xsl:if>
<xsl:text>
</xsl:text>
</xsl:text>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

@@ -44,7 +44,7 @@
public static void main(String[] args) {
...
}
</code></p>
</code></p>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

@@ -563,7 +563,7 @@
public static void main(String[] args) {
...
}
</code></p>
</code></p>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline issue here

@josteinaj
Copy link
Member Author

merged into master in d15c4ef 🤞

@josteinaj josteinaj closed this Nov 9, 2022
@josteinaj josteinaj deleted the editorconfig-formatted branch November 9, 2022 10:24
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 this pull request may close these issues.

4 participants