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 tab before multi line TXT string #23

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Fix tab before multi line TXT string #23

wants to merge 4 commits into from

Conversation

pjjonesnz
Copy link

Ignore tabs before the start of the string in a multi line TXT record
Add exception if multi line is still open when function ends

If there are tabs at the beginning of the second (or subsequent) lines in a multi line TXT record, the tokenizer only returns the first line of text. It correctly ignores space and newline, but currently doesn't ignore tab.

While this may not be too widespread, the functions that DirectAdmin (server management software) uses to create TXT records inserts tabs at the beginning of the second (and subsequent) lines of a multi line TXT record, and as DirectAdmin is widely used it would be nice to be able to support this.

Add exception if multi line is still open when function ends
@pjjonesnz
Copy link
Author

Here is the Direct Admin page where it shows how their txt records look. However note that the whitespace in their example is created using tabs.

https://help.directadmin.com/item.php?id=552

@pjjonesnz
Copy link
Author

pjjonesnz commented Mar 20, 2021

I've updated the txtExtractor and extractCharSet functions to use the AsciiChar class.

Have also modified the code so that quotes are not required around a txt record as per RFC1035

character-string is expressed in one or two ways: as a contiguous set
of characters without interior spaces, or as a string beginning with a "
and ending with a "

Have updated the "hell" test file txt records to reflect these possibilities and all tests still pass.

Allow quotes mid-stream in unquoted string
Character terminates unquoted string
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.

None yet

1 participant