mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Merge branch 'upsilon-dev-latex'
This commit is contained in:
@@ -117,7 +117,7 @@ const char * EndOfPrintableWord(const char * word, const char * end) {
|
||||
UTF8Decoder decoder(word);
|
||||
CodePoint codePoint = decoder.nextCodePoint();
|
||||
const char * result = word;
|
||||
while (codePoint != '\n' && codePoint != ' ' && codePoint != '%') {
|
||||
while (codePoint != '\n' && codePoint != ' ' && codePoint != '%' && codePoint != '$') {
|
||||
result = decoder.stringPosition();
|
||||
if (result >= end) {
|
||||
break;
|
||||
@@ -127,4 +127,21 @@ const char * EndOfPrintableWord(const char * word, const char * end) {
|
||||
return result;
|
||||
}
|
||||
|
||||
const char * StartOfPrintableWord(const char * word, const char * start) {
|
||||
if (word == start) {
|
||||
return word;
|
||||
}
|
||||
UTF8Decoder decoder(start, word);
|
||||
CodePoint codePoint = decoder.previousCodePoint();
|
||||
const char * result = word;
|
||||
while (codePoint != '\n' && codePoint != ' ' && codePoint != '%' && codePoint != '$') {
|
||||
result = decoder.stringPosition();
|
||||
if (result <= start) {
|
||||
break;
|
||||
}
|
||||
codePoint = decoder.previousCodePoint();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user