File tree Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Expand file tree Collapse file tree 2 files changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -262,8 +262,6 @@ let raw_markup =
262
262
let raw_markup_target =
263
263
([^ ':' '%' ] | '%' + [^ ':' '%' '}' ])* '%' *
264
264
265
- let math_block = raw_markup
266
-
267
265
let language_tag_char =
268
266
['a' - 'z' 'A' - 'Z' '0' - '9' '_' '-' ]
269
267
@@ -366,19 +364,13 @@ rule token input = parse
366
364
{ verbatim
367
365
(Buffer. create 1024 ) None (Lexing. lexeme_start lexbuf) input lexbuf }
368
366
369
- | " {%math" horizontal_space (raw_markup as s) (" %}" | eof as e)
370
- { let token = `Math (true , s) in
371
- if e <> " %}" then
372
- warning
373
- input
374
- ~start_offset: (Lexing. lexeme_end lexbuf)
375
- (Parse_error. not_allowed
376
- ~what: (Token. describe `End )
377
- ~in_what: (Token. describe token));
378
- emit input token }
379
367
| " {%" ((raw_markup_target as target) ':' )? (raw_markup as s)
380
368
(" %}" | eof as e)
381
- { let token = `Raw_markup (target, s) in
369
+ { let token =
370
+ match target with
371
+ | Some "math" -> `Math (true , s)
372
+ | _ -> `Raw_markup (target, s)
373
+ in
382
374
if e <> " %}" then
383
375
warning
384
376
input
Original file line number Diff line number Diff line change @@ -5310,7 +5310,7 @@ let%expect_test _ =
5310
5310
let%expect_test _ =
5311
5311
let module Math = struct
5312
5312
let block =
5313
- test "{%math \\sum_{i=0}^n x^i%}";
5313
+ test "{%math: \\sum_{i=0}^n x^i%}";
5314
5314
[%expect {|
5315
5315
((output
5316
5316
(((f.ml (1 0) (1 25))
You can’t perform that action at this time.
0 commit comments