mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
fix formatting
This commit is contained in:
parent
394fc41819
commit
d445eb0bb0
@ -23,8 +23,7 @@ constexpr size_t SOFT_HYPHEN_BYTES = 2;
|
||||
// (no space before it). Includes sentence punctuation and closing quotes.
|
||||
// Excludes brackets/parens to avoid false positives with decorative patterns like "[ 1 ]".
|
||||
bool isAttachingPunctuation(const char c) {
|
||||
return c == '.' || c == ',' || c == '!' || c == '?' || c == ';' || c == ':' ||
|
||||
c == '"' || c == '\'';
|
||||
return c == '.' || c == ',' || c == '!' || c == '?' || c == ';' || c == ':' || c == '"' || c == '\'';
|
||||
}
|
||||
|
||||
// Check if a word consists entirely of punctuation that should attach to the previous word
|
||||
@ -437,8 +436,7 @@ void ParsedText::extractLine(const size_t breakIndex, const int pageWidth, const
|
||||
// Add spacing after this word, unless the next word is attaching punctuation
|
||||
auto nextWordIt = wordIt;
|
||||
++nextWordIt;
|
||||
const bool nextIsAttachingPunctuation =
|
||||
wordIdx + 1 < lineWordCount && isAttachingPunctuationWord(*nextWordIt);
|
||||
const bool nextIsAttachingPunctuation = wordIdx + 1 < lineWordCount && isAttachingPunctuationWord(*nextWordIt);
|
||||
|
||||
xpos += currentWordWidth + (nextIsAttachingPunctuation ? 0 : spacing);
|
||||
++wordIt;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user