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.

Encoded HTML ssr/browser rendering

See original GitHub issue

Really 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:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
bcomnescommented, Aug 4, 2017

Would this be worth exporting as a bundled-but-separate utility function?

Read more comments on GitHub >

github_iconTop 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 >

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