Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Don't replace whitespace sequences with a single space within an entry.#5

Open
adrek14 wants to merge 1 commit into
liskin:masterfrom
adrek14:keep_whitespace
Open

Don't replace whitespace sequences with a single space within an entry.#5
adrek14 wants to merge 1 commit into
liskin:masterfrom
adrek14:keep_whitespace

Conversation

@adrek14

@adrek14 adrek14 commented Aug 16, 2015

Copy link
Copy Markdown

hnb's XML parser collapses common whitespace chars into single space on read. For instance, string "foo bar" will be properly displayed and written to .xml file as a hnb entry, but when read it will be collapsed to "foo bar" (and will overwrite the old one, when written to file).

The parser is a state machine. This commit introduces the following: if the parses is in state s_word and encounters whitespace, it stores the whitespace as part of the word and remains in the s_word state. Works for me, though I can't guarantee not having any side effects.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant