objectionary / objectionary/lints
`DfContext` HTML entity decoding is incomplete and introduces platform-specific inconsistencies
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 14
- Forks
- 39
- Avg merge
- 22h 54m
- Merged PRs (30d)
- 90
Description
Problem
DfContext (which decodes HTML entities in defect @context) decodes incompletely and platform-dependently, so contexts can contain literal </" remnants and differ between operating systems.
Root cause
src/main/java/org/eolang/lints/DfContext.java:60-64:
this.context = defect.context()
.replace(" ", System.lineSeparator())
.replace(""", "\"")
.replace("&", "&");
&is replaced last, so double-encoded input like&lt;becomes<(still encoded) instead of<.- The standard entities
"and'/'are not handled (only"), so a context using"keeps the literal". 
is replaced withSystem.lineSeparator()(\r\non Windows,\non Unix), while XML normalization always means LF — the resulting context differs across OSes and breaks string comparisons.
Minimal example
A context value &lt;o&gt; should decode to <o> but yields <o>; a value "x" keeps "x" verbatim.
Expected behavior
Decode entities in a single normalized pass:
- replace
&first (or loop until stable), - handle
",',', /
, - use a fixed
\nfor line breaks, notSystem.lineSeparator().
Related
src/test/java/org/eolang/lints/DfContextTest.java— only covers the happy path; the double-encoding and entity variants are untested.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/main/java/org/eolang/lints/DfContext.java:60-64 to trace the current entity decoding, then read src/test/java/org/eolang/lints/DfContextTest.java. Add coverage for double-encoded entities, quote and apostrophe variants, and normalized line breaks. Done means these cases decode consistently to the expected context on every operating system.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100