Skip to content

fix: support linebreaks in Raw element#305

Merged
shellscape merged 1 commit into
shellscape:mainfrom
timofei-iatsenko:fix/raw-element-linebreaks
Aug 20, 2025
Merged

fix: support linebreaks in Raw element#305
shellscape merged 1 commit into
shellscape:mainfrom
timofei-iatsenko:fix/raw-element-linebreaks

Conversation

@timofei-iatsenko

Copy link
Copy Markdown
Contributor

Component / Package Name: <Raw />

Support linebreaks in the <Raw> element. I came across this issue trying to implement some more complicated logic for keycloack email templates:

        <Raw
          content={`
    <#assign requiredActionsText>
        <#if requiredActions??>
           <#list requiredActions>
              <#items as reqActionItem>
                 \${msg("requiredAction.\${reqActionItem}")} <#sep>,</#sep>
              </#items>
           </#list>
        </#if>
    </#assign>
    `}
        />

And that was rendered with underlying <jsx-email-raw><!-- ... --></jsx-email-raw>:

<jsx-email-raw><!--
    <#assign requiredActionsText>
        <#if requiredActions??>
           <#list requiredActions>
              <#items as reqActionItem>
                 ${msg("requiredAction.${reqActionItem}")} <#sep>,</#sep>
              </#items>
           </#list>
        </#if>
    </#assign>
    --></jsx-email-raw>

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

If yes, please include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.

List any relevant issue numbers:

Description

@timofei-iatsenko
timofei-iatsenko force-pushed the fix/raw-element-linebreaks branch from 3e181ef to ca218d2 Compare August 18, 2025 10:05
@timofei-iatsenko
timofei-iatsenko force-pushed the fix/raw-element-linebreaks branch from ca218d2 to e1921e3 Compare August 18, 2025 10:06

@shellscape shellscape left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the PR!

@shellscape
shellscape merged commit 1196527 into shellscape:main Aug 20, 2025
6 checks passed
@timofei-iatsenko
timofei-iatsenko deleted the fix/raw-element-linebreaks branch August 20, 2025 13:26
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