Test fix for bug #26

This commit is contained in:
Kevin Boone
2023-05-03 21:35:42 +01:00
parent 0e31500990
commit 6fd1a332a6
3 changed files with 11 additions and 1 deletions

View File

@@ -238,6 +238,12 @@ void _wraptext_wrap_next (WrapTextContext *context, const WT_UTF32 c)
// STATE_WORD
else if (state == WT_STATE_WORD && c == WT_HARD_LINE_BREAK)
{
_wraptext_flush_token (context);
_wraptext_new_line (context);
state = WT_STATE_START;
}
else if (state == WT_STATE_WORD && _wraptext_is_newline (c))
{
_wraptext_flush_token (context);

View File

@@ -13,6 +13,9 @@
// UTF8, including a terminating 0
#define WT_UTF8_MAX_BYTES 8
// Hard line break should be an unusued code point
#define WT_HARD_LINE_BREAK 9999
typedef uint32_t WT_UTF32;
typedef char WT_UTF8;

View File

@@ -632,7 +632,8 @@ void xhtml_flush_para (const WString *para, const Epub2TxtOptions *options,
void xhtml_line_break (WrapTextContext *context)
{
IN
static uint32_t s[2] = { '\n', 0 };
//static uint32_t s[2] = { '\n', 0 };
static uint32_t s[2] = { WT_HARD_LINE_BREAK, 0 };
wraptext_wrap_utf32 (context, s);
wraptext_eof (context);
OUT