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.

Custom-style-map doesn't affect built-in 'Quick Styles'

See original GitHub issue

I have the following in a text file:

p[style-name='Test Style'] => div.aside > h2:fresh
p[style-name='Test Style2'] => div.aside > p:fresh
p[style-name='Emphasis'] => div.aside > p:fresh

I’m running this from the command line using the ‘–style-map’ flag pointed at the above file. The first two style rules take affect as expected. The third rule does nothing. The same goes for any of the built-in (pre-defined) Quick Styles in Word.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
MCTaylor17commented, Apr 7, 2015

Thank you for the quick response. You are correct about case-sensitivity, but only for the various heading levels. I looked at the XML and it looks like the Quick Styles I was having trouble with were w:type="character" rather than w:type="paragraph". The solution is to use r[style-name='Emphasis'] rather than p[style-name='Emphasis'].

Here’s a summary of my findings for the pre-defined Quick Styles in MS Word:

p-type:
Title
Subtitle
No Spacing
Quote
Intense Quote
List Paragraph
p-type & lowercase:
heading 1
heading 2
heading 3
heading 4
heading 5
heading 6
r-type:
Subtle Emphasis
Emphasis
Intense Emphasis
Strong
Subtle Reference
Intense Reference
Book Title

On the subject of case sensitivity, would it be difficult to make the style-maps case-insensitive?

0reactions
MCTaylor17commented, Apr 8, 2015

Nicely done!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Changing customStyleMap doesn't trigger re-render until ...
After customStyleMap is changed, nothing happens until contentState ... But the changes to the style map that I pass do not have any...
Read more >
React inline style doesn't affect my custom component
You need to take the style prop given to MyComponent and add it to the style prop of one of the elements inside...
Read more >
Complex Inline Styles - Draft.js
Mapping a style string to CSS​​ Within your Editor use case, you may provide the customStyleMap prop to define your style objects. (See...
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