Skip to content

fix: preserve newlines in ACMP test cases#673

Open
mbicl wants to merge 2 commits into
jmerle:masterfrom
mbicl:fix/acmp-problem-parser
Open

fix: preserve newlines in ACMP test cases#673
mbicl wants to merge 2 commits into
jmerle:masterfrom
mbicl:fix/acmp-problem-parser

Conversation

@mbicl

@mbicl mbicl commented Dec 15, 2025

Copy link
Copy Markdown

Previously, the ACMP parser used textContent to extract test inputs and outputs, which ignored <br> tags and flattened multi-line test cases into a single line. This commit updates the parser to use innerText, which correctly preserves visual formatting, including <br> tags and newlines, ensuring test cases are parsed with the correct structure.
I tested this change locally using two different problem pages from ACMP (using cpeditor.org):

  1. first problem
    before change:
image

after change:
image
2. second problem - both working good in this case.

Previously, the ACMP parser used `textContent` to extract test inputs and outputs, which ignored `<br>` tags and flattened multi-line test cases into a single line.
This commit updates the parser to use `innerText`, which correctly preserves visual formatting, including `<br>` tags and newlines, ensuring test cases are parsed with the correct structure.
Previously, the ACMP parser used `textContent` to extract test inputs and outputs, which ignored `<br>` tags and flattened multi-line test cases into a single line.
This commit updates the parser to use `innerText`, which correctly preserves visual formatting, including `<br>` tags and newlines, ensuring test cases are parsed with the correct structure.
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.

1 participant