plurimath 0.10.4 → 0.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/lib/plurimath/mathml/formula_transformation.rb +24 -9
- data/lib/plurimath/mathml/translator.rb +1 -4
- data/lib/plurimath/version.rb +1 -1
- metadata +2 -32
- data/TODO.bad_symbols.md +0 -45
- data/TODO.bugs/01-unitsml-enoent.md +0 -28
- data/TODO.bugs/02-system-stack-error-cloned-objects.md +0 -34
- data/TODO.bugs/03-omml-underover-displaystyle.md +0 -23
- data/TODO.bugs/04-unitsml-spec-diffs.md +0 -20
- data/TODO.bugs/05-omml-greek-entity-encoding.md +0 -50
- data/TODO.bugs/mml_custom_model_child_order.md +0 -149
- data/TODO.fix-fails/01-phantom-whitespace.md +0 -63
- data/TODO.fix-fails/02-table-parentheses-latex.md +0 -17
- data/TODO.fix-fails/03-longidv-tag-mathml.md +0 -17
- data/TODO.fix-fails/04-mmultiscript-none-mathml.md +0 -17
- data/TODO.fix-fails/05-mstyle-nary-oint-mathml.md +0 -17
- data/TODO.fix-fails/06-issue-238-mathml.md +0 -17
- data/TODO.fix-fails/07-metanorma-bipm-latex.md +0 -19
- data/TODO.fix-fails/08-metanorma-itu-latex.md +0 -17
- data/TODO.fix-fails/09-omml-greek-encoding.md +0 -24
- data/TODO.fix-fails/10-omml-underover-greek.md +0 -19
- data/TODO.fix-fails/11-omml-multiscripts-zwsp.md +0 -19
- data/TODO.fix-fails/12-omml-oint-integral.md +0 -19
- data/TODO.fix-fails/13-omml-nary-prod.md +0 -19
- data/TODO.fix-fails/14-omml-empty-mo.md +0 -19
- data/TODO.fix-fails/REMAINING_FAILURES.md +0 -168
- data/TODO.fix-tests/00-overview.md +0 -102
- data/TODO.fix-tests/01-zero-width-space.md +0 -34
- data/TODO.fix-tests/02-html-linebreak.md +0 -41
- data/TODO.fix-tests/03-phantom-whitespace.md +0 -34
- data/TODO.fix-tests/04-mathml-structure.md +0 -33
- data/TODO.fix-tests/05-omml-rendering.md +0 -27
- data/TODO.mml-plurimath-model.md +0 -86
- data/lib/plurimath/mathml/utility/formula_transformation.rb +0 -143
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# 05 - mstyle containing nary oint (MathML structure)
|
|
2
|
-
|
|
3
|
-
## Test Location
|
|
4
|
-
`spec/plurimath/mathml_spec.rb:1366`
|
|
5
|
-
|
|
6
|
-
## Issue Summary
|
|
7
|
-
Test "contains mstyle containing nary oint value in msubsup tag" fails with MathML element_structure differences.
|
|
8
|
-
|
|
9
|
-
## Failure Details
|
|
10
|
-
- Element structure mismatch in MathML output
|
|
11
|
-
- Issue with nary operator rendering inside msubsup
|
|
12
|
-
|
|
13
|
-
## Possible Cause
|
|
14
|
-
The LutaML-Model update changed how nary operators are handled within subscript/superscript elements.
|
|
15
|
-
|
|
16
|
-
## Status
|
|
17
|
-
**Pre-existing from LutaML-Model update**
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# 06 - plurimath/issue#238 (MathML structure)
|
|
2
|
-
|
|
3
|
-
## Test Location
|
|
4
|
-
`spec/plurimath/mathml_spec.rb:1540`
|
|
5
|
-
|
|
6
|
-
## Issue Summary
|
|
7
|
-
Test "contains string from plurimath/issue#238" fails with MathML element_structure differences.
|
|
8
|
-
|
|
9
|
-
## Failure Details
|
|
10
|
-
- 4-5 dimension differences in XML comparison
|
|
11
|
-
- Complex MathML structure issue
|
|
12
|
-
|
|
13
|
-
## Possible Cause
|
|
14
|
-
The issue #238 was about a specific MathML rendering problem that the LutaML-Model update may have affected.
|
|
15
|
-
|
|
16
|
-
## Status
|
|
17
|
-
**Pre-existing from LutaML-Model update**
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# 07 - metanorma-cli-actions-mn-bipm (LaTeX structure)
|
|
2
|
-
|
|
3
|
-
## Test Location
|
|
4
|
-
`spec/plurimath/mathml_spec.rb:1713`
|
|
5
|
-
|
|
6
|
-
## Issue Summary
|
|
7
|
-
Test "contains input from metanorma-cli-actions-mn-bipm run" fails with LaTeX comparison.
|
|
8
|
-
|
|
9
|
-
## Expected LaTeX
|
|
10
|
-
`\underline{\mathit{B}} = \left [ ... \end{matrix}\right ]`
|
|
11
|
-
|
|
12
|
-
## Got LaTeX
|
|
13
|
-
`\underset{ \left ( \underline \right ) }{ \left ( \mathit{B} \right ) } = \left [ ... \end{matrix}\right ]`
|
|
14
|
-
|
|
15
|
-
## Issue
|
|
16
|
-
The LaTeX rendering of the underline/enclose structure is different - the structure of how `underline` wraps `B` has changed.
|
|
17
|
-
|
|
18
|
-
## Status
|
|
19
|
-
**Pre-existing from LutaML-Model update**
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# 08 - metanorma-cli-actions-mn-itu (LaTeX spacing)
|
|
2
|
-
|
|
3
|
-
## Test Location
|
|
4
|
-
`spec/plurimath/mathml_spec.rb:1860`
|
|
5
|
-
|
|
6
|
-
## Issue Summary
|
|
7
|
-
Test "contains input from metanorma-cli-actions-mn-itu run" fails with LaTeX comparison.
|
|
8
|
-
|
|
9
|
-
## Expected
|
|
10
|
-
`y_{k} = ( x_{k} \pm h ) m`
|
|
11
|
-
(Got: `y_{k} = ( x_{k} \pm h ) m`)
|
|
12
|
-
|
|
13
|
-
## Issue
|
|
14
|
-
Double space before `m` in expected, single space in our output. This is likely related to how `None#to_latex` or similar empty-returning functions are handled.
|
|
15
|
-
|
|
16
|
-
## Status
|
|
17
|
-
**Pre-existing from LutaML-Model update**
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# 09 - OMML Greek letter encoding (multiple tags)
|
|
2
|
-
|
|
3
|
-
## Test Location
|
|
4
|
-
`spec/plurimath/mathml_spec.rb:2452`
|
|
5
|
-
|
|
6
|
-
## Issue Summary
|
|
7
|
-
Test "contains multiple tags in Mathml" fails with OMML comparison due to Greek letter encoding.
|
|
8
|
-
|
|
9
|
-
## Expected
|
|
10
|
-
`<m:t>α</m:t>` (HTML entity)
|
|
11
|
-
`<m:t>θ</m:t>` (HTML entity)
|
|
12
|
-
|
|
13
|
-
## Got
|
|
14
|
-
`<m:t>α</m:t>` (Unicode character)
|
|
15
|
-
`<m:t>θ</m:t>` (Unicode character)
|
|
16
|
-
|
|
17
|
-
## Issue
|
|
18
|
-
Greek letters are being output as Unicode characters instead of HTML entities. This is the **Greek letter encoding issue** documented in `TODO.bugs/05-omml-greek-entity-encoding.md`.
|
|
19
|
-
|
|
20
|
-
## Cause
|
|
21
|
-
Ox serializer outputs Unicode characters directly instead of HTML entities.
|
|
22
|
-
|
|
23
|
-
## Status
|
|
24
|
-
**Pre-existing from LutaML-Model update - KNOWN ISSUE**
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# 10 - OMML Greek letter encoding (underover)
|
|
2
|
-
|
|
3
|
-
## Test Location
|
|
4
|
-
`spec/plurimath/mathml_spec.rb:2663`
|
|
5
|
-
|
|
6
|
-
## Issue Summary
|
|
7
|
-
Test "contains underover, under, and over tags with displaystyle false" fails with OMML comparison.
|
|
8
|
-
|
|
9
|
-
## Expected
|
|
10
|
-
`<m:t>θ</m:t>` (HTML entity)
|
|
11
|
-
|
|
12
|
-
## Got
|
|
13
|
-
`<m:t>θ</m:t>` (Unicode character)
|
|
14
|
-
|
|
15
|
-
## Issue
|
|
16
|
-
Greek letter theta encoding issue - same as test 09.
|
|
17
|
-
|
|
18
|
-
## Status
|
|
19
|
-
**Pre-existing from LutaML-Model update - KNOWN ISSUE**
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# 11 - OMML multiscripts ZWSP handling
|
|
2
|
-
|
|
3
|
-
## Test Location
|
|
4
|
-
`spec/plurimath/mathml_spec.rb:3121`
|
|
5
|
-
|
|
6
|
-
## Issue Summary
|
|
7
|
-
Test "contains multiscripts containing none tag" fails with OMML comparison.
|
|
8
|
-
|
|
9
|
-
## Expected
|
|
10
|
-
`<m:t>​</m:t>` (ZWSP - Zero-Width Space)
|
|
11
|
-
|
|
12
|
-
## Got
|
|
13
|
-
`<m:t></m:t>` (empty)
|
|
14
|
-
|
|
15
|
-
## Issue
|
|
16
|
-
ZWSP (Zero-Width Space, U+200B) placeholder is not being rendered in OMML output. The empty `m:t` element suggests the ZWSP character is being lost.
|
|
17
|
-
|
|
18
|
-
## Status
|
|
19
|
-
**Pre-existing from LutaML-Model update**
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# 12 - OMML oint msubsup missing integral
|
|
2
|
-
|
|
3
|
-
## Test Location
|
|
4
|
-
`spec/plurimath/mathml_spec.rb:3201`
|
|
5
|
-
|
|
6
|
-
## Issue Summary
|
|
7
|
-
Test "contains oint msubsup tag" fails with OMML comparison.
|
|
8
|
-
|
|
9
|
-
## Expected
|
|
10
|
-
Structure includes `<m:t>∮</m:t>` (contour integral symbol ∮)
|
|
11
|
-
|
|
12
|
-
## Got
|
|
13
|
-
Missing the integral symbol in output
|
|
14
|
-
|
|
15
|
-
## Issue
|
|
16
|
-
The integral symbol `∮` is not appearing in the OMML output for nary operators.
|
|
17
|
-
|
|
18
|
-
## Status
|
|
19
|
-
**Pre-existing from LutaML-Model update**
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# 13 - OMML nary prod missing integral
|
|
2
|
-
|
|
3
|
-
## Test Location
|
|
4
|
-
`spec/plurimath/mathml_spec.rb:3365`
|
|
5
|
-
|
|
6
|
-
## Issue Summary
|
|
7
|
-
Test "contains nary prod symbol in underover for nary tag" fails with OMML comparison.
|
|
8
|
-
|
|
9
|
-
## Expected
|
|
10
|
-
Structure includes integral symbol
|
|
11
|
-
|
|
12
|
-
## Got
|
|
13
|
-
Structure differs from expected
|
|
14
|
-
|
|
15
|
-
## Issue
|
|
16
|
-
Similar to test 12 - nary product/integral operator rendering issue in OMML.
|
|
17
|
-
|
|
18
|
-
## Status
|
|
19
|
-
**Pre-existing from LutaML-Model update**
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# 14 - OMML empty mo example
|
|
2
|
-
|
|
3
|
-
## Test Location
|
|
4
|
-
`spec/plurimath/mathml_spec.rb:3486`
|
|
5
|
-
|
|
6
|
-
## Issue Summary
|
|
7
|
-
Test "contains empty mo example from plurimath/plurimath#318" fails with OMML comparison.
|
|
8
|
-
|
|
9
|
-
## Expected
|
|
10
|
-
`<m:t>±</m:t>` (plus-minus sign ±)
|
|
11
|
-
|
|
12
|
-
## Got
|
|
13
|
-
`<m:t></m:t>` (empty)
|
|
14
|
-
|
|
15
|
-
## Issue
|
|
16
|
-
Empty `mo` element (representing ±) is not being rendered correctly in OMML output.
|
|
17
|
-
|
|
18
|
-
## Status
|
|
19
|
-
**Pre-existing from LutaML-Model update**
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
# MathML Translator: Remaining 14 Failing Tests
|
|
2
|
-
|
|
3
|
-
## Context
|
|
4
|
-
|
|
5
|
-
This document describes the 14 MathML translator tests that remain failing after the LutaML-Model update. The fixes for 17 other tests are in this PR; these require additional investigation.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Summary of Fixed Tests
|
|
10
|
-
|
|
11
|
-
17 tests were resolved by addressing:
|
|
12
|
-
- `None#to_latex` and `None#to_asciimath` returning `nil` instead of `""`
|
|
13
|
-
- Whitespace preservation in `mo_to_symbol`
|
|
14
|
-
- Filtering empty strings from formula output
|
|
15
|
-
- Fixing `Plus#to_mathml_without_math_tag` to use `value` instead of hardcoded `"+"`
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Remaining 14 Failing Tests
|
|
20
|
-
|
|
21
|
-
### Category 1: MathML Structure Issues (5 tests)
|
|
22
|
-
|
|
23
|
-
#### 1. Test 281: Phantom Tag Whitespace
|
|
24
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:281`
|
|
25
|
-
- **Test**: `contains Mathml phantom tag's example`
|
|
26
|
-
- **Issue**: Expected `<mo>+</mo>` (no spaces) inside `<mphantom>`, but output is `<mo> + </mo>` (with spaces)
|
|
27
|
-
- **Input**: `<mo> + </mo>` inside `<mphantom>`
|
|
28
|
-
- **Note**: The second `<mo> + </mo>` outside phantom correctly preserves spaces. Issue is specific to `mphantom`.
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
#### 2. Test 1197: Longidv Tag
|
|
33
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:1197`
|
|
34
|
-
- **Test**: `contains longidv tag Mathml`
|
|
35
|
-
- **Issue**: 3 element_structure differences in XML comparison
|
|
36
|
-
- **Hint**: `longidv` involves `mscarries` elements. LutaML update changed parsing/rendering of these.
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
#### 3. Test 1319: Mmultiscript with None Tag
|
|
41
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:1319`
|
|
42
|
-
- **Test**: `contains mmultiscript containing none tag`
|
|
43
|
-
- **Issue**: Element structure mismatch for `mmultiscripts` containing `<none>` elements
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
#### 4. Test 1366: Mstyle with Nary Oint
|
|
48
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:1366`
|
|
49
|
-
- **Test**: `contains mstyle containing nary oint value in msubsup tag`
|
|
50
|
-
- **Issue**: Element structure differences with nary operators inside `msubsup`
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
#### 5. Test 1540: Issue #238
|
|
55
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:1540`
|
|
56
|
-
- **Test**: `contains string from plurimath/issue#238`
|
|
57
|
-
- **Issue**: 4-5 element_structure differences in complex MathML structure
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
### Category 2: LaTeX Output Issues (3 tests)
|
|
62
|
-
|
|
63
|
-
#### 6. Test 778: Table with Parentheses (Metanorma)
|
|
64
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:778`
|
|
65
|
-
- **Test**: `contains table with surrounding parentheses(metanorma example) and sqrt tag`
|
|
66
|
-
- **Issue**: LaTeX comparison fails - expected and got look identical but differ in invisible characters
|
|
67
|
-
- **Hint**: Use byte-level comparison (`xxd`, `od -c`) to identify the difference
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
#### 7. Test 1713: Metanorma BIPM Run
|
|
72
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:1713`
|
|
73
|
-
- **Test**: `contains input from metanorma-cli-actions-mn-bipm run`
|
|
74
|
-
- **Expected**: `\underline{\mathit{B}} = \left [ ... \end{matrix}\right ]`
|
|
75
|
-
- **Got**: `\underset{ \left ( \underline \right ) }{ \left ( \mathit{B} \right ) } = \left [ ... \end{matrix}\right ]`
|
|
76
|
-
- **Hint**: `menclose` with `notation="updiagonalstrike"` rendering changed from `\underline{...}` to `\underset{...}{...}` form
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
#### 8. Test 1860: Metanorma ITU Run
|
|
81
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:1860`
|
|
82
|
-
- **Test**: `contains input from metanorma-cli-actions-mn-itu run`
|
|
83
|
-
- **Expected**: `y_{k} = ( x_{k} \pm h ) m` (double space before `m`)
|
|
84
|
-
- **Got**: `y_{k} = ( x_{k} \pm h ) m` (single space)
|
|
85
|
-
- **Hint**: Related to how `None` elements contribute spacing
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
### Category 3: OMML Rendering Issues (6 tests)
|
|
90
|
-
|
|
91
|
-
**Root Cause**: Ox serializer outputs Unicode characters instead of HTML entities. See `TODO.bugs/05-omml-greek-entity-encoding.md`.
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
#### 9. Test 2452: Multiple Tags - Greek Encoding
|
|
96
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:2452`
|
|
97
|
-
- **Expected**: `<m:t>α</m:t>`, `<m:t>θ</m:t>`
|
|
98
|
-
- **Got**: `<m:t>α</m:t>`, `<m:t>θ</m:t>`
|
|
99
|
-
|
|
100
|
-
---
|
|
101
|
-
|
|
102
|
-
#### 10. Test 2663: Underover with Greek
|
|
103
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:2663`
|
|
104
|
-
- **Expected**: `<m:t>θ</m:t>`
|
|
105
|
-
- **Got**: `<m:t>θ</m:t>`
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
#### 11. Test 3121: Multiscripts None - ZWSP
|
|
110
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:3121`
|
|
111
|
-
- **Expected**: `<m:t>​</m:t>` (ZWSP - Zero-Width Space)
|
|
112
|
-
- **Got**: `<m:t></m:t>` (empty)
|
|
113
|
-
- **Hint**: ZWSP (U+200B) used as placeholder in multiscripts is being dropped by Ox serializer
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
#### 12. Test 3201: Oint Msubsup - Missing Integral
|
|
118
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:3201`
|
|
119
|
-
- **Expected**: Contains `<m:t>∮</m:t>` (contour integral ∮)
|
|
120
|
-
- **Got**: Integral symbol missing
|
|
121
|
-
- **Hint**: Nary operator `oint` not rendering in OMML within msubsup context
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
#### 13. Test 3365: Nary Prod Symbol
|
|
126
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:3365`
|
|
127
|
-
- **Issue**: Same as test 12 - integral symbol `∮` missing
|
|
128
|
-
- **Hint**: Similar nary operator issue with product notation
|
|
129
|
-
|
|
130
|
-
---
|
|
131
|
-
|
|
132
|
-
#### 14. Test 3486: Empty MO Example
|
|
133
|
-
- **Location**: `spec/plurimath/mathml_spec.rb:3486`
|
|
134
|
-
- **Expected**: `<m:t>±</m:t>` (plus-minus sign ±)
|
|
135
|
-
- **Got**: `<m:t></m:t>` (empty)
|
|
136
|
-
- **Hint**: Symbol value being lost in translation for empty `mo` elements
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## Investigation Files
|
|
141
|
-
|
|
142
|
-
Detailed notes in:
|
|
143
|
-
- `TODO.fix-fails/01-phantom-whitespace.md` through `TODO.fix-fails/14-omml-empty-mo.md`
|
|
144
|
-
- `TODO.bugs/05-omml-greek-entity-encoding.md`
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Hints
|
|
149
|
-
|
|
150
|
-
1. **MathML Structure**: Compare AST structure before/after LutaML update. Focus on `translator.rb` handling of `mphantom`, `mmultiscripts`, `mscarries`, `munderover`.
|
|
151
|
-
|
|
152
|
-
2. **LaTeX Whitespace**: Use byte-level comparison to identify invisible character differences. Issue likely in how empty/nil values contribute spacing.
|
|
153
|
-
|
|
154
|
-
3. **OMML Issues**:
|
|
155
|
-
- Greek encoding: Post-process Ox output to convert Unicode to HTML entities, or use Oga adapter instead
|
|
156
|
-
- ZWSP/Empty MO: Investigate how Ox handles special Unicode characters (U+200B, U+00B1, U+222E)
|
|
157
|
-
|
|
158
|
-
---
|
|
159
|
-
|
|
160
|
-
## Testing
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
# All failing tests
|
|
164
|
-
bundle exec rspec spec/plurimath/mathml_spec.rb --format documentation
|
|
165
|
-
|
|
166
|
-
# Single test
|
|
167
|
-
bundle exec rspec spec/plurimath/mathml_spec.rb:281 --format documentation
|
|
168
|
-
```
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# MathML Spec Test Failures Investigation
|
|
2
|
-
|
|
3
|
-
## Summary
|
|
4
|
-
41 tests total: 22 passing, 19 failing
|
|
5
|
-
- 2 issues FIXED by current changes (Category 2 linebreak, Category 3 LaTeX part)
|
|
6
|
-
- These failures existed BEFORE mo_element fix and are pre-existing issues from lutaml-model update.
|
|
7
|
-
|
|
8
|
-
## Failure Categories
|
|
9
|
-
|
|
10
|
-
### Category 1: ZERO WIDTH SPACE serialization in OMML (7 tests)
|
|
11
|
-
**Tests:** 2452, 2913, 3039, 3121, 3201, 3365, 3486
|
|
12
|
-
|
|
13
|
-
**Issue:** `<m:t>​</m:t>` becomes `<m:t></m:t>` or `<m:t/>`
|
|
14
|
-
|
|
15
|
-
**Root Cause:** Ox serialization issue - empty elements serialized as `<m:t></m:t>` instead of `<m:t/>`
|
|
16
|
-
|
|
17
|
-
**Example diff:**
|
|
18
|
-
```
|
|
19
|
-
- <m:t/>
|
|
20
|
-
+ <m:t></m:t>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
### Category 2: Linebreak positioning in HTML (FIXED)
|
|
26
|
-
**Tests:** 3594
|
|
27
|
-
|
|
28
|
-
**Issue:** `<br/>` positioned before operator instead of after
|
|
29
|
-
|
|
30
|
-
**Example diff:**
|
|
31
|
-
```
|
|
32
|
-
- <i>N</i><sub>s</sub><sup>2</sup> =<br/> T <br/>↑ S <br/> D
|
|
33
|
-
+ <i>N</i><sub>s</sub><sup>2</sup> <br/>= T <br/>↑ S <br/> D
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
**Root Cause:** `linebreakstyle="after"` not being passed to Linebreak constructor.
|
|
37
|
-
|
|
38
|
-
**FIXED:** Now passes `linebreakstyle` attribute and uses `mathml_unary_classes` for proper encoding.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
### Category 3: LaTeX whitespace in phantom (PARTIALLY FIXED)
|
|
43
|
-
**Tests:** 281
|
|
44
|
-
|
|
45
|
-
**Issue:** `\phantom{ y }` vs `\phantom{y}` - whitespace stripped from phantom content
|
|
46
|
-
|
|
47
|
-
**Example diff:**
|
|
48
|
-
```
|
|
49
|
-
- " x \\phantom{+} \\phantom{ y } + z "
|
|
50
|
-
+ "x \\phantom{+} \\phantom{y} + z"
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
**Root Cause:** Symbol class strips whitespace when creating symbol value.
|
|
54
|
-
|
|
55
|
-
**FIXED for LaTeX output:** After `mathml_unary_classes` creates Symbol, restore original value to preserve whitespace.
|
|
56
|
-
**Still failing:** MathML structure issue (mrow wrapper missing) - pre-existing bug.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
### Category 4: MathML structure differences (8 tests)
|
|
61
|
-
**Tests:** 213, 778, 1197, 1272, 1319, 1366, 1540, 1713
|
|
62
|
-
|
|
63
|
-
**Issue:** XML structure differences with msubsup, mrow element positioning
|
|
64
|
-
|
|
65
|
-
**Example diff:**
|
|
66
|
-
```
|
|
67
|
-
Element_position differs: mrow at position 0 vs position 1
|
|
68
|
-
Element differs: msubsup → (empty)
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
**Root Cause:** Likely mml parsing issue with nested elements in semantics.
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
### Category 5: OMML rendering issues (3 tests)
|
|
76
|
-
**Tests:** 2559, 2663, 2790
|
|
77
|
-
|
|
78
|
-
**Issue:** limLow, accent, sSubSup not rendering correctly
|
|
79
|
-
|
|
80
|
-
**Example:** Expected limLow with proper lim printing, but got different structure.
|
|
81
|
-
|
|
82
|
-
**Root Cause:** Translator OMML rendering issues.
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## Recommendations
|
|
87
|
-
|
|
88
|
-
### For Category 1 (ZERO WIDTH SPACE)
|
|
89
|
-
This is an Ox serialization issue. Empty elements are being serialized as `<m:t></m:t>` instead of `<m:t/>`.
|
|
90
|
-
Likely requires changes to how lutaml-model/Ox handles empty element serialization.
|
|
91
|
-
|
|
92
|
-
### For Category 2 (HTML linebreak) - FIXED
|
|
93
|
-
No further action needed.
|
|
94
|
-
|
|
95
|
-
### For Category 3 (Phantom whitespace) - PARTIALLY FIXED
|
|
96
|
-
LaTeX output is now correct. MathML structure issue requires investigation into mrow handling.
|
|
97
|
-
|
|
98
|
-
### For Category 4 (MathML structure)
|
|
99
|
-
Investigate mml parsing of semantics elements and how children are ordered.
|
|
100
|
-
|
|
101
|
-
### For Category 5 (OMML rendering)
|
|
102
|
-
Fix translator OMML rendering for limLow, accent, and sSubSup elements.
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Category 1: ZERO WIDTH SPACE Serialization in OMML
|
|
2
|
-
|
|
3
|
-
## Affected Tests
|
|
4
|
-
- 2452: contains multiple tags in Mathml
|
|
5
|
-
- 2913: mfrac with options/attributes tag
|
|
6
|
-
- 3039: mpadded with attributes
|
|
7
|
-
- 3121: multiscripts containing none tag
|
|
8
|
-
- 3201: oint msubsup tag
|
|
9
|
-
- 3365: nary prod symbol in underover
|
|
10
|
-
- 3486: empty mo example from plurimath/plurimath#318
|
|
11
|
-
|
|
12
|
-
## Issue
|
|
13
|
-
`<m:t>​</m:t>` (zero-width space) becomes `<m:t></m:t>` or `<m:t/>` in OMML output.
|
|
14
|
-
|
|
15
|
-
## Root Cause
|
|
16
|
-
In `lib/plurimath/math/core.rb`, the `empty_tag` method:
|
|
17
|
-
```ruby
|
|
18
|
-
def empty_tag(wrapper_tag = nil)
|
|
19
|
-
r_tag = ox_element("r", namespace: "m")
|
|
20
|
-
r_tag << (ox_element("t", namespace: "m") << "​")
|
|
21
|
-
...
|
|
22
|
-
end
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The `​` entity is being lost during Ox element serialization.
|
|
26
|
-
|
|
27
|
-
## Investigation Needed
|
|
28
|
-
1. Check how `ox_element` and Ox handle HTML entities in text content
|
|
29
|
-
2. Verify if this is a lutaml-model issue or an issue with how Plurimath uses Ox
|
|
30
|
-
3. Test if using raw Unicode character U+200B directly works instead of entity
|
|
31
|
-
|
|
32
|
-
## Related Files
|
|
33
|
-
- `lib/plurimath/math/core.rb:48-54` - empty_tag method
|
|
34
|
-
- `lib/plurimath/math/symbols/symbol.rb` - Symbol rendering
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
# Category 2: HTML Linebreak Positioning
|
|
2
|
-
|
|
3
|
-
## Affected Tests
|
|
4
|
-
- 3594: contains subsup and linebreak with different values example in MathML
|
|
5
|
-
|
|
6
|
-
## Issue
|
|
7
|
-
`<br/>` is positioned BEFORE the operator instead of AFTER when `linebreakstyle="after"` is set.
|
|
8
|
-
|
|
9
|
-
## Example Diff
|
|
10
|
-
```
|
|
11
|
-
Expected: "<i>N</i><sub>s</sub><sup>2</sup> =<br/> T <br/>↑ S <br/> D"
|
|
12
|
-
Actual: "<i>N</i><sub>s</sub><sup>2</sup> <br/>= T <br/>↑ S <br/> D"
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Note: Also `↑` (entity) becomes `↑` (literal Unicode character).
|
|
16
|
-
|
|
17
|
-
## Root Cause
|
|
18
|
-
In `lib/plurimath/math/function/linebreak.rb`, the `to_html` method:
|
|
19
|
-
```ruby
|
|
20
|
-
def to_html(options:)
|
|
21
|
-
br_tag = "<br/>"
|
|
22
|
-
return br_tag unless parameter_one
|
|
23
|
-
|
|
24
|
-
case attributes[:linebreakstyle]
|
|
25
|
-
when "after"
|
|
26
|
-
"#{parameter_one.to_html(options: options)}#{br_tag}"
|
|
27
|
-
else
|
|
28
|
-
"#{br_tag}#{parameter_one.to_html(options: options)}"
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
The `linebreakstyle` attribute is being passed from MathML but may not be properly captured or applied.
|
|
34
|
-
|
|
35
|
-
## Investigation Needed
|
|
36
|
-
1. Check if `mo_to_symbol` properly captures `linebreakstyle` attribute from `<mo linebreak="newline" linebreakstyle="after">`
|
|
37
|
-
2. Verify that Linebreak class stores and uses this attribute correctly
|
|
38
|
-
|
|
39
|
-
## Related Files
|
|
40
|
-
- `lib/plurimath/math/function/linebreak.rb`
|
|
41
|
-
- `lib/plurimath/mathml/translator.rb` - mo_to_symbol
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# Category 3: LaTeX Whitespace in Phantom
|
|
2
|
-
|
|
3
|
-
## Affected Tests
|
|
4
|
-
- 281: phantom tag's example
|
|
5
|
-
|
|
6
|
-
## Issue
|
|
7
|
-
Whitespace is stripped from phantom content in LaTeX output.
|
|
8
|
-
|
|
9
|
-
## Example Diff
|
|
10
|
-
```
|
|
11
|
-
Expected: " x \\phantom{+} \\phantom{ y } + z "
|
|
12
|
-
Actual: "x \\phantom{+} \\phantom{y} + z"
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Leading/trailing spaces inside `\phantom{}` are being lost.
|
|
16
|
-
|
|
17
|
-
## Root Cause
|
|
18
|
-
In `lib/plurimath/mathml/translator.rb`, `mi_to_symbol`:
|
|
19
|
-
```ruby
|
|
20
|
-
stripped = value.strip
|
|
21
|
-
...
|
|
22
|
-
result = Plurimath::Utility.mathml_unary_classes([stripped], lang: :mathml)
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The whitespace is stripped when creating the Symbol. When Phantom renders via `latex_value`, it uses `parameter_one.to_latex` which returns the stripped value.
|
|
26
|
-
|
|
27
|
-
## Investigation Needed
|
|
28
|
-
1. Check if Symbol class should preserve whitespace in value
|
|
29
|
-
2. Or if Phantom class should handle whitespace differently
|
|
30
|
-
|
|
31
|
-
## Related Files
|
|
32
|
-
- `lib/plurimath/mathml/translator.rb:149-166` - mi_to_symbol
|
|
33
|
-
- `lib/plurimath/math/function/phantom.rb`
|
|
34
|
-
- `lib/plurimath/math/symbols/symbol.rb`
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Category 4: MathML Structure Differences
|
|
2
|
-
|
|
3
|
-
## Affected Tests
|
|
4
|
-
- 213: contains Mathml object (msubsup in semantics)
|
|
5
|
-
- 778: table with surrounding parentheses
|
|
6
|
-
- 1197: longidv tag
|
|
7
|
-
- 1272: mpadded with attributes
|
|
8
|
-
- 1319: mmultiscript containing none tag
|
|
9
|
-
- 1366: mstyle containing nary oint value in msubsup
|
|
10
|
-
- 1540: plurimath/issue#238
|
|
11
|
-
- 1713: metanorma-cli-actions-mn-bipm
|
|
12
|
-
|
|
13
|
-
## Issue
|
|
14
|
-
Element structure differs - msubsup/mrow positions are wrong or elements are empty when they shouldn't be.
|
|
15
|
-
|
|
16
|
-
## Example Diff (test 213)
|
|
17
|
-
```
|
|
18
|
-
Position: mrow at position 0 vs position 1
|
|
19
|
-
Element differs: msubsup → (empty)
|
|
20
|
-
Element differs: mrow → (empty)
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
## Root Cause
|
|
24
|
-
Likely related to how mml parses `<semantics>` elements and orders children. The translator may not be properly handling the `semantics` wrapper and its `annotation` child elements.
|
|
25
|
-
|
|
26
|
-
## Investigation Needed
|
|
27
|
-
1. Check how mml gem parses semantics elements
|
|
28
|
-
2. Verify `mrow_to_mrow` correctly handles semantics content
|
|
29
|
-
3. Check `ordered_children` method for proper ordering
|
|
30
|
-
|
|
31
|
-
## Related Files
|
|
32
|
-
- `lib/plurimath/mathml/translator.rb` - mrow_to_mrow, ordered_children
|
|
33
|
-
- `lib/plurimath/math/formula.rb` - mrow handling
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# Category 5: OMML Rendering Issues
|
|
2
|
-
|
|
3
|
-
## Affected Tests
|
|
4
|
-
- 2559: scarries, longdiv, msline and scarry tags
|
|
5
|
-
- 2663: underover, under, and over tags with displaystyle false
|
|
6
|
-
- 2790: bar, vec, dot, ddot, ul, and tilde examples containing accent
|
|
7
|
-
|
|
8
|
-
## Issue
|
|
9
|
-
OMML output has incorrect structure for limLow, accent, sSubSup elements.
|
|
10
|
-
|
|
11
|
-
## Example Issues
|
|
12
|
-
- `limLow` not rendering with proper lim printing
|
|
13
|
-
- Accent elements not properly structured
|
|
14
|
-
- sSubSup vs sSub/sSup structure issues
|
|
15
|
-
|
|
16
|
-
## Root Cause
|
|
17
|
-
Likely issues in the translator's OMML rendering methods for these specific elements.
|
|
18
|
-
|
|
19
|
-
## Investigation Needed
|
|
20
|
-
1. Check `PowerBase#to_omml_without_math_tag` for sSubSup handling
|
|
21
|
-
2. Check accent/overline rendering for OMML
|
|
22
|
-
3. Check nary functions (integral, product) OMML output
|
|
23
|
-
|
|
24
|
-
## Related Files
|
|
25
|
-
- `lib/plurimath/math/function/power_base.rb`
|
|
26
|
-
- `lib/plurimath/math/function/nary.rb`
|
|
27
|
-
- `lib/plurimath/mathml/translator.rb`
|