-
Notifications
You must be signed in to change notification settings - Fork 60
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
_text Extension Rendering as Plain Text Instead of HTML in LHC-Forms #156
Comments
There is a 'allowHTML' in templateOption (https://github.com/LHNCBC/lforms/blob/master/form_definition.md) that is false by default. You need to add the optional 'options' parameter to addFormToPage function to turn that on. LForms.Util.addFormToPage(formDef, "formContainer", {"allowHTML": true}); Let me know if it works. |
@lhcye Thanks for the suggestion. Unfortunately, it didn’t work for me. The form still displays "Item 0" instead of rendering the HTML content from the You can check the issue here. The problem persists, and the expected HTML is ignored. Could you please take another look and provide further guidance on how to resolve this? Thanks again for your support! |
You used lforms v34.0.0. Supporting html on item.text was added on v36.4.0. The validation function on html content was updated later after that. You'd better to use the latest v36.10.2 if you could. I tested on 36.10.2 and 36.8.0. Both worked fine with your test data. |
@lhcye Yes, thank you! It's working in the latest version. Would you like us to get proper documentation anywhere? In this documentation, we didn't find any mentions of the |
These options are mentioned somewhere in a few files but not explictly listed on the documentation site. We will update the site soon. Thanks. |
Description
When rendering a FHIR
Questionnaire
using LHC-Forms, the_text
extension withrendering-xhtml
does not replace the default question text. Instead, thetext
field value is displayed, and the HTML content inside_text
is ignored.Steps to Reproduce
Import the R4 Questionnaire JSON and render it using JavaScript:
Use the following JavaScript to define and load the form:
Observe the issue in the browser
Instead of rendering the expected HTML content from
_text
, the question displays as"Item 0"
.The expected HTML is ignored.
Expected Behavior
Actual Behavior
Environment
The text was updated successfully, but these errors were encountered: