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.

using <b> tag will break the line

See original GitHub issue

Using <b> tag inside a string will break the line.

<HTMLView
  value={ "A word will be <b>bold</b> inside this string." }
/>
  • Expected:

A word will be bold inside this string."

  • What I got acctually with react-native-htmlview:

A word will be bold inside this string."

By the way, is there any convenient tag to add attributes to specific words in a string?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
agustindcommented, Jun 26, 2017

Had the same problem, fixed it like this:

<HTMLView style={{flex:1, flexDirection: 'row', alignItems: 'flex-start', flexWrap: 'wrap'}} value={myhtmlcontent} />

6reactions
richchurchercommented, Jul 3, 2017

Yes, that behaviour’s probably not ideal right now. It’s not just <b>: even a <span> will reproduce this. Note that it’s not an issue if you can wrap the content in a block-level tag:

  <div>A word will be <b>bold</b> inside this string.</div>

I imagine there’s a reasonable way to correct this, but for now it’ll probably require a wrapper.

Read more comments on GitHub >

github_iconTop Results From Across the Web

<br>: The Line Break element - HTML - MDN Web Docs - Mozilla
The <br> HTML element produces a line break in text (carriage-return). It is useful for writing a poem or an address, where the...
Read more >
HTML Line Break – How to Break a Line with the HTML <br ...
Basic HTML Line Break Syntax. You can insert line breaks in HTML with the <br> tag, which is equivalent to a carriage return...
Read more >
The Dos and Don'ts of Adding an HTML Line Break
To do a line break in HTML, use the <br> tag. Simply place the tag wherever you want to force a line break....
Read more >
What is the correct way of using , , or in HTML? - Tutorialspoint
There are multiple correct ways to use a br tag in the web documents. In HTML, a line break is made with the...
Read more >
HTML <br> Tag - GeeksforGeeks
In this article, we will know how to add line-break using HTML <br> tag. The browser does not recognize new line and paragraph...
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