Skip to content
Commit 2cd9e132 authored by Bernd Buschinski's avatar Bernd Buschinski
Browse files

Replace pairs of spaces with "<space>&nbsp;" to preserve some semblance of text wrapping

code:   filteredLine.replace("  ", " \xA0");
This used to work like above. But just for normal text like "test    test"
It got replaced as "test \xA0 \xA0test" and QTextEdit showed 4 spaces.
In case of color/italic/bold codes we don't necessary get a real pair of spaces
just "test<html> <html> <html> <html> test" and QTextEdit shows it as 1 space.
Now if we remember the last char, to ignore html tags, and check if current and last ones are spaces
we replace the current one with \xA0 (a forced space) and get
"test<html> <html>\xA0<html> <html>\xA0test", which QTextEdit correctly shows as 4 spaces.
BUG: 270376
parent 53e78d56
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment