In the book and quill editor screen (see first screenshot), legacy formatting codes (those starting with §) affect only the text up to the end of its visual line. In contrast, legacy formatting codes apply to the end of the page or until a conflicting code when viewing a signed book or a book in a lectern (second screenshot).
Reproduction
Type the command
/give @s minecraft:writable_book[minecraft:writable_book_content={pages:["\u00A74The quick brown fox jumps over the lazy dog"]}]Open the resulting book and quill
Expected behavior: All of the lines of text should look dark red
Actual behavior: Only the first line looks red; the subsequent lines are black
Thank you for helping us improve Minecraft! We saved your files: