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

Random <br> tags in the output from JSON schema rendering? #617

Open
exwhyz opened this issue Nov 14, 2022 · 0 comments
Open

Random <br> tags in the output from JSON schema rendering? #617

exwhyz opened this issue Nov 14, 2022 · 0 comments
Labels
❓ Question Question about one of the samples

Comments

@exwhyz
Copy link

exwhyz commented Nov 14, 2022

I am using List formatting JSON to customize the Board view in Microsoft Lists in Microsoft 365. I have a description field/column set to Single line of text (which is a string without any HTML tags that I have validated with the Microsoft Graph API call to that List item). I am applying the following JSON formatting syntax to that field:

....
          {
            "elmType": "div",
            "children": [
              {
                "elmType": "p",
                "attributes": {
                  "class": "ms-fontColor-neutralSecondary"
                },
                "txtContent": "=[$Description]"
            ],
            "attributes": {
              "class": "sp-card-displayColumnContainer"
            }
          },
....

And the field renders fine except I am seeing <br> tags added by the JSON renderer, when I inspect the DOM via Chrome. For some fields the <br> tag is added in the middle of the text and for other multiple <br> tags are added at the end - see the 2 outputs below with the <br> tags introduced in the middle/end of the text. It appears the formatter is adding this unilaterally to space out the text thereby creating unnecessary white space.

Is there a way to control this behavior and force the JSON renderer to not apply any additional formatting besides what is specified in the JSON?

Output 1 (Note multiple <br> tags inside the <p> tag at the end of the text):

<div class="sp-card-displayColumnContainer">
    <p data-custom-card-path="#.0.1.0" data-event-trigger="hover" id="-1_#.0.1.0_undefined_0" data-is-focusable="true" class="ms-fontColor-neutralSecondary">
        Global Client Agreement for full review (Abacus Pharma)<br><br><br>
    </p>
</div>

Output 2 (Note the single <br> tag inside the <p> tag in the middle of the text):

<div class="sp-card-displayColumnContainer">
    <p data-custom-card-path="#.0.1.0" data-event-trigger="hover" id="-1_#.0.1.0_undefined_0" data-is-focusable="true" class="ms-fontColor-neutralSecondary">
        Request to seek approval and contract between Vendor and<br>Provider to support client.
    </p>
</div>
@exwhyz exwhyz added the ❓ Question Question about one of the samples label Nov 14, 2022
@exwhyz exwhyz changed the title Is it normal to see <br> tags by the rendering schema Is it normal to see <br> tags by the rendering schema outputs Nov 14, 2022
@exwhyz exwhyz changed the title Is it normal to see <br> tags by the rendering schema outputs Is it normal to see random <br> tags by the rendering schema outputs Nov 14, 2022
@exwhyz exwhyz changed the title Is it normal to see random <br> tags by the rendering schema outputs Is it normal to see random <br> tags in the outputs from the JSON schema rendering? Nov 14, 2022
@exwhyz exwhyz changed the title Is it normal to see random <br> tags in the outputs from the JSON schema rendering? Is it normal to see random <br> tags in the outputs from JSON schema rendering? Nov 14, 2022
@exwhyz exwhyz changed the title Is it normal to see random <br> tags in the outputs from JSON schema rendering? Random <br> tags in the outputs from JSON schema rendering? Nov 14, 2022
@exwhyz exwhyz changed the title Random <br> tags in the outputs from JSON schema rendering? Random <br> tags in the output from JSON schema rendering? Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ Question Question about one of the samples
Projects
None yet
Development

No branches or pull requests

1 participant