You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
They way things are right now, cufón will attempt to render the text " Lorem ipsum ", not “Lorem ipsum” as you might expect. The issue may seem simple, but what about:
```
Lorem
ipsum dolor
sit
amet
```
Which of the newlines should be removed? Depending on the styling of the elements the answer can be either some, all or none of them. For instance the strong element may have display: block, or the h1 may have display: inline. At the moment all elements are treated as display: inline, which often leads to incorrect results with block-level elements.
Solution: make text replacement context-aware.
The text was updated successfully, but these errors were encountered:
To begin with, I'd recommend trimming any whitespace from the start and end of a block element, this would fix the immediate issues I've had with this.
Well, I've implemented a fairly simple fix in commit 9810b4c that should solve the most common issues. Like kelvinj suggested, white space at the beginning and end of a block level element (basically any display value except inline, inline-block and run-in) is removed.
Improving white space handling any further would be pretty much pointless.
Consider the following HTML:
```
Lorem ipsum
```
They way things are right now, cufón will attempt to render the text " Lorem ipsum ", not “Lorem ipsum” as you might expect. The issue may seem simple, but what about:
```
Lorem
ipsum
dolor
sit
amet
```
Which of the newlines should be removed? Depending on the styling of the elements the answer can be either some, all or none of them. For instance the strong element may have display: block, or the h1 may have display: inline. At the moment all elements are treated as display: inline, which often leads to incorrect results with block-level elements.
Solution: make text replacement context-aware.
The text was updated successfully, but these errors were encountered: