Use Base64 to encode html when rendering Markdown files #1102

Merged
kekkyojin merged 1 commit from fix-markdown-rendering into master 2021-01-12 08:33:40 +01:00
kekkyojin commented 2020-12-29 11:49:26 +01:00 (Migrated from github.com)

PR Checklist

Please check all that apply to this PR using "x":

  • I have checked that this PR is not a duplicate of an existing PR (open, closed or merged)
  • I have checked that this PR does not introduce a breaking change

PR Type

What kind of change does this PR introduce?

  • Bugfix

Fixes

Issue Number: #960 -still partially fixed, don't close it-

What is the current behavior?

Some problems are still showing up when using the octothorpe character

What is the new behavior?

New code fixes it by encoding the HTML string using Base64, as recommended by Google. Additionally, it no longer requires to run a regex matching, making it faster.

Testing

Search for "octothorpe-test" on the LBRY Android app and open the one on the "javirid" channel, as it includes some problematic cases. Currently it shows a few problems still. With this PR applied, everything looks fine. Compare it with the rendered Markdown on LBRY.TV

## PR Checklist <!-- For the checkbox formatting to work properly, make sure there are no spaces on either side of the "x" --> Please check all that apply to this PR using "x": - [x] I have checked that this PR is not a duplicate of an existing PR (open, closed or merged) - [x] I have checked that this PR does not introduce a breaking change ## PR Type What kind of change does this PR introduce? - [x] Bugfix ## Fixes Issue Number: #960 -still partially fixed, don't close it- ## What is the current behavior? Some problems are still showing up when using the octothorpe character ## What is the new behavior? New code fixes it by encoding the HTML string using Base64, as recommended by [Google](https://developer.android.com/reference/android/webkit/WebView#loadData(java.lang.String,%20java.lang.String,%20java.lang.String)). Additionally, it no longer requires to run a regex matching, making it faster. ## Testing Search for "octothorpe-test" on the LBRY Android app and open the one on the "javirid" channel, as it includes some problematic cases. Currently it shows a few problems still. With this PR applied, everything looks fine. Compare it with the rendered Markdown on [LBRY.TV](https://lbry.tv/@javirid:9/octothorpe-test:6)
akinwale (Migrated from github.com) approved these changes 2021-01-12 08:33:12 +01:00
akinwale (Migrated from github.com) left a comment

Looks good.

Looks good.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-android#1102
No description provided.