This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
Problem with templates => body => background => html => text #81
Labels
jasonette-ios
Jasonette iOS related issues
Describe the bug
Yesterday a russian member of the community posted a question on telegram and I tried to figure it out.
His objective was to use an html site as a background and alert the user whenever there was no network activity.
I found that there appears to be a bug whereby using templates => body => background => html => text instead of url does not render correctly.
I was attempting to accomplish this by using $network.request and catch the network error, and render the downloaded html on success. Since this needs a template, I could no longer use background => url but was using background => text. It seems that background => text sanitises the output rendered in some way (maybe this is intentional, but then it appears to serve no purpose as the $render already specifies the type - there should be at least a background "raw" paramenter if this is indeed on purpose).
In the examples below I stripped out all the JSON code irrelevant to the actual bug for the sake of brevity.
Example Jasonette Document URLs & JSON files
I created 3 apps to demonstrate this problem:
https://raw.githubusercontent.com/opsarl/jasonelle/master/bug-report-ok.json
The result is this:
https://raw.githubusercontent.com/opsarl/jasonelle/master/but-report-error.json
The result is this:
This was also tried with any and all combinations of "data_type": using "raw" etc. with any $render types to no avail.
https://raw.githubusercontent.com/opsarl/jasonelle/master/bug-report-text.json
The result is this:
To Reproduce
Run each app listed above.
Expected behavior
background => html => text should simply render the content of the "text" option so it looks like example 1).
Screenshots
See above.
Smartphone (please complete the following information):
Compilation:
Additional context
Please see "Describe the bug" for context.
I would appreciate any workaround or idea on how to fix. I read through the source code to attempt to find the problem and it may be in JasonViewController.m. Unfortunately I am not an Objective-C expert or I would attempt to provide a fix. I could not find where the html is lost in translation exactly but it seems like it gets lost right in the end.
The text was updated successfully, but these errors were encountered: