Encoded HTML ssr/browser rendering
See original GitHub issueReally enjoying the new SSR capabilities with bel! I wanted to render some Markdown output on the server recently, and with @yoshuawuyts’s help was able to get this working in both the browser and SSR by doing something like this:
var example = format('<p>some example</p><h2>markdown output</h2>')
function format (str) {
if (typeof window !== 'undefined') {
var wrapper = html`<div></div>`
wrapper.innerHTML = str
return wrapper
} else {
var wrapper = new String(str)
wrapper.__encoded = true
return wrapper
}
}
And a little interactive example using Glitch. Super awesome, but a little verbose. Maybe there is a way to do this using a single unified method? #42
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Rendering to HTML (Report Builder and SSRS)
In Report Builder, the HTML rendering extension renders paginated reports in HTML format. It can produce full HTML pages or fragments to ...
Read more >SSRS how to render HTML escaped character - Stack Overflow
Right-click on the non-design surface of your report and click Report Properties... . Click the References option, click Add in Add or ...
Read more >Part 2 - Issues and Challenges After Migration of Microsoft SQL
In Part-1, SSRS migration steps have been discussed. Many congratulations for SSRS migration but migration journey is not yet over.
Read more >Launch SSRS Report in Browser from a .NET Application
This is probably the simplest way to render a report from an application; you just need to put together a URL that represents...
Read more >What's Up With the Slow SSRS R2 Rendering in SharePoint ...
Side note: The ExecutionLog2 is a view specifically for reporting on SQL Server 2008. It provides several derived fields which decode the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Would this be worth exporting as a bundled-but-separate utility function?
https://github.com/choojs/nanohtml/blob/master/raw.js !