Skip to content

Petrakeas/cli special characters update - #37

Merged
n1k0sv merged 2 commits into
transifex:develfrom
Petrakeas:petrakeas/cli_special_characters_update
Sep 17, 2022
Merged

n1k0sv merged 2 commits into
transifex:develfrom
Petrakeas:petrakeas/cli_special_characters_update

Conversation

@Petrakeas

Copy link
Copy Markdown
Contributor

No description provided.

The cli tool parses the provided strings.xml files and pushes them
to CDS. Before this update, it left special characters such as new lines, tabs,
multiple spaces, single or double quotes etc untouched.

With this update the, the behavior of Android's XML parser is followed as
outlined here:  https://developer.android.com/guide/topics/resources/string-resource

The exact mechanics  have been documented in StringXMLConverter#unescapeJavaString().

When `TxNative#setSupportSpannable()` is disabled, the SDK used to perform only these
conversations:
*  "&lt;" to  "<"
*  "&gt;" to  ">"
Now it also performs the following:
*  "&amp;"  to "&"
This functionality has been moved to  `Utils#unescapeHTMLEntities()` .

When `TxNative#setSupportSpannable()` is enabled, it no longer passes all strings through
`fromHTML()`. If the string contains no spans, it is passed through `Utils#unescapeHTMLEntities()`
as usual. This is to preserve new lines and multiple spaces, which `fromHTML()` removes.

The app has been updated to contain a string with HTML markup. It's not rendered stylized
by default. In MyApplication.java, the setSupportSpannabled() has to be commented in.

The readme has been updated to include a section regarding string styling.

Unit tests have been added to cover all cases in txsdk and cli modules.
Changes have been so that the links generated for androidx are correct.

Frames have also been re-enabled using the "--frames" javadoc options.
Currently, this results in rendering a "frames, "no frames" toggle at the
top of the documentation.
@n1k0sv
n1k0sv merged commit 9bdf7ae into transifex:devel Sep 17, 2022
@wyngarde wyngarde mentioned this pull request Sep 27, 2022
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.

2 participants