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.

Lists bullets and numbers are always Black

See original GitHub issue

Hi there,

Firstable, thanks for this library, its being awesome to render on react-native.

Nobody tried to change the baseFontColor and render lists? on a black background I changed font style with the prop:

baseFontStyle={{ fontSize: 14, lineHeight: 14 * 1.5, color: 'white' }}

But could not see bullets or list numbers.

As a solution I have extended the props of the baseFontStyle to this tags.

You can see the fixes here:

https://github.com/kikoseijo/react-native-render-html/commits/master

basically I did something like this for the <ol>

<Text style={[baseFontStyle, { marginRight: 5, fontSize: baseFontSize }]}>{index + 1})</Text>

and the following for the <ul>

...
backgroundColor: baseFontStyle.color ? baseFontStyle.color : 'black'

Solution its not the best I guess, but…

Bug, enhancement or my bad?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

11reactions
donni106commented, Sep 24, 2018

@ziyafenn sure, here a code snippet to replace ) in ol with .:

...
html={html}
listsPrefixesRenderers={{
  ol: (_htmlAttribs, _children, _convertedCSSStyles, passProps) => (
    <Text style={style}>{passProps.index + 1}.</Text>
  )
}}
...
9reactions
nbolendercommented, Oct 18, 2018

If anyone is looking for a way to fix this, here are the default renderers. You’ll have to drop in your own font size and color.

...
listsPrefixesRenderers={{
	ul: (_htmlAttribs, _children, _convertedCSSStyles, passProps) => {
		return <View style={{
			marginRight: 10,
			width: myFontSize / 2.8,
			height: myFontSize / 2.8,
			marginTop: myFontSize / 2,
			borderRadius: myFontSize / 2.8,
			backgroundColor: myBulletColor,
		}}/>
	},
	ol: (_htmlAttribs, _children, _convertedCSSStyles, passProps) => {
		return <Text style={{ marginRight: 5, fontSize: myFontSize }}>{ passProps.index + 1 })</Text>
	},
}}
...
Read more comments on GitHub >

github_iconTop Results From Across the Web

Lists bullets and numbers are always Black #165 - GitHub
Hi there,. Firstable, thanks for this library, its being awesome to render on react-native. Nobody tried to change the baseFontColor and ...
Read more >
Leveled Numbering list turns to black box after combining 3 ...
After combining three documents that contained track changes and reviewer comments, heading numbers for levels two and four became blacked ...
Read more >
List bullets are black on dark background / text not alligned
Hello Got a problem with the list bullets and numbers, they are all always dark and the text is not really vertical aligned...
Read more >
How to change the color of bulleted characters in InDesign
Quick tip: How to change the color of the bullets in a bulleted lists in Adobe InDesign, and how to define paragraph style...
Read more >
2020-04-03 - Managing Bullets and Numbering Using Styles
Word - Managing Bullets and Numbering Using StylesGetting bullets, ... the formatting and application of bulleted lists, numbered lists, ...
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