question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Textarea Macro Parameter Not Rendering HTML Markup

See original GitHub issue

In Umbraco v8, I am inserting a macro into the grid editor.

I am using a macro to embed a hubspot form code into a parameter that is a textarea called embed.

The macro itself just renders the embed code in the parameter like so: @Html.Raw(Model.MacroParameters["embed"])

The output of this is literally printing the html markup that I put into the macro parameter.

If I output just the parameter without Html.Raw then I get the decoded markup printed out. ( & instead of “&”)

When I tested just entering this macro into the RTE, the macro disappears on save.

I was able to do this in previous versions of Umbraco just fine but it seems that I can no longer do this in v8. I posted this on our as well.


This item has been added to our backlog AB#2540

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
gopkumrcommented, Sep 6, 2019

@bkclerke the macro parameter value is stored encoded and hence when you use the @Html.Raw(..) it renders the html mark up. As a workaround i tried performing a decode before passing it onto the Raw function and i was able to render the HTML form. Below is the code i used. @Html.Raw(System.Web.HttpUtility.HtmlDecode(Convert.ToString(Model.MacroParameters["embed"])))

PS:Not a good one, but might able to help you until the bug is resolved.

I couldn’t manage to get the backoffice showing the form render but the webpage shows it right.

Hope this helps.

1reaction
nul800sebastiaancommented, Sep 6, 2019

Thanks @bkclerke - I can reproduce the error. Now to find the cause… 🙈

Read more comments on GitHub >

github_iconTop Results From Across the Web

umbraco 8 textarea macro parameter not rendering html ...
I am using a macro to embed a hubspot form code into a parameter that is a textarea called embed . The macro...
Read more >
ReactJS component not rendering textarea with state ...
The string is not printed in the textarea. I tried this to debug: render() { var summary = "this is a summary" ...
Read more >
How to override MacroBrowser postPreview function?
Hi all, I am currently modifying the Mermaid Macro Plugin on Confluence Server such that users can input the diagram code directly in...
Read more >
Getting Input for a Macro
Here is an example that inserts a pair of HTML markup tags specified by the user. // Insert_Tag.bsh void insertTag() { caret =...
Read more >
The Textarea element - HTML: HyperText Markup Language
This attribute enables you to place <textarea> elements anywhere within a document, not just as descendants of form elements. maxlength. The ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found