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

Fix an issue where no newline is present after the doctype when indent=no #5370

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

line-o
Copy link
Member

@line-o line-o commented Jul 16, 2024

fixes #4736

Before

<!DOCTYPE html>
<option selected></option>

AFTER

<!DOCTYPE html><option selected></option>

@line-o line-o requested a review from a team as a code owner July 16, 2024 15:19
Copy link
Member

@dizzzz dizzzz left a comment

Choose a reason for hiding this comment

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

test issue in webdav

@line-o
Copy link
Member Author

line-o commented Jul 23, 2024

@dizzz yes I saw that too. I will push updates soon.

Copy link

sonarcloud bot commented Jul 25, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
50.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@line-o line-o requested a review from dizzzz August 1, 2024 07:53
@line-o
Copy link
Member Author

line-o commented Aug 1, 2024

If you load XML via doc() then the whitespace with newlines is recreated as stored.
indent=no does not have an effect on persistent nodes themselves.

@line-o
Copy link
Member Author

line-o commented Aug 1, 2024

@dizzzz this PR does only change the behaviour of the doctype.

@line-o line-o requested a review from a team August 1, 2024 07:56
@@ -42,7 +42,7 @@ public void setUp() throws Exception {

@Test
public void testAttributeWithBooleanValue() throws Exception {
final String expected = "<!DOCTYPE html>\n<input checked>";
final String expected = "<!DOCTYPE html><input checked>";
Copy link
Contributor

Choose a reason for hiding this comment

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

I am a bit confused. I thought the purpose of your change was to ensure that there was always a line break after the doctype declaration. Your changes to this test seem to show the opposite though.

@@ -847,36 +847,39 @@ function ser:serialize-xml-134() {
};

declare
%test:assertEquals('<!DOCTYPE html> <option selected></option>')
%test:assertEquals('<!DOCTYPE html><option selected></option>')
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question as above.

"<!DOCTYPE bookmap PUBLIC \"-//OASIS//DTD DITA BookMap//EN\" \"bookmap.dtd\">\n" +
"<bookmap id=\"bookmap-1\"/>";
"<!DOCTYPE bookmap PUBLIC \"-//OASIS//DTD DITA BookMap//EN\" \"bookmap.dtd\">" +
"<bookmap id=\"bookmap-1\"><title>The Title</title></bookmap>";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why add a child element here, it doesn't seem that it has changed anything else about the test?

@adamretter adamretter changed the title [bugfix] no newline after doctype with indent=no Fix an issue where no newline is present after the doctype when indent=no Oct 8, 2024
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.

[BUG] doctype and html with output option indent 'no'
3 participants