Skip to content

Commit

Permalink
Media: newline in alt text are turned into spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
panglesd committed Aug 23, 2024
1 parent f99f1de commit 57ed927
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/parser/lexer.mll
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,9 @@ and media tok_descr buffer nesting_level start_offset input = parse
~what:(Token.describe `End)
~in_what:tok_descr);
Buffer.contents buffer}
| (newline)
{ Buffer.add_char buffer ' ';
media tok_descr buffer nesting_level start_offset input lexbuf }
| _ as c
{ Buffer.add_char buffer c;
media tok_descr buffer nesting_level start_offset input lexbuf }
Expand Down
3 changes: 1 addition & 2 deletions src/parser/test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2167,8 +2167,7 @@ let%expect_test _ =
{|
((output
(((f.ml (1 0) (2 5))
(simple ((f.ml (1 8) (2 -6)) (Reference foo)) "bar \
\n baz" image))))
(simple ((f.ml (1 8) (2 -6)) (Reference foo)) "bar baz" image))))
(warnings ())) |}]
end in
()
Expand Down

0 comments on commit 57ed927

Please sign in to comment.