Skip to content

Commit

Permalink
Test fix for bug kevinboone#26
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinboone committed May 3, 2023
1 parent 0e31500 commit 6fd1a33
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions src/wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
3 changes: 2 additions & 1 deletion src/xhtml.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6fd1a33

Please sign in to comment.