mml 2.3.7 → 2.4.0
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/CLAUDE.md +90 -30
- data/lib/mml/base/maction.rb +1 -1
- data/lib/mml/base/math.rb +1 -1
- data/lib/mml/base/menclose.rb +1 -1
- data/lib/mml/base/merror.rb +1 -1
- data/lib/mml/base/mfenced.rb +1 -4
- data/lib/mml/base/mfrac.rb +1 -1
- data/lib/mml/base/mfraction.rb +1 -1
- data/lib/mml/base/mi.rb +2 -0
- data/lib/mml/base/mlabeledtr.rb +1 -1
- data/lib/mml/base/mlongdiv.rb +1 -1
- data/lib/mml/base/mmultiscripts.rb +1 -1
- data/lib/mml/base/mn.rb +2 -0
- data/lib/mml/base/mo.rb +6 -1
- data/lib/mml/base/mover.rb +1 -1
- data/lib/mml/base/mpadded.rb +1 -1
- data/lib/mml/base/mphantom.rb +1 -1
- data/lib/mml/base/mroot.rb +1 -1
- data/lib/mml/base/mrow.rb +1 -3
- data/lib/mml/base/ms.rb +4 -0
- data/lib/mml/base/mscarries.rb +1 -1
- data/lib/mml/base/mscarry.rb +1 -1
- data/lib/mml/base/msgroup.rb +1 -3
- data/lib/mml/base/msqrt.rb +1 -1
- data/lib/mml/base/msrow.rb +1 -1
- data/lib/mml/base/mstack.rb +1 -1
- data/lib/mml/base/mstyle.rb +1 -1
- data/lib/mml/base/msub.rb +1 -1
- data/lib/mml/base/msubsup.rb +1 -1
- data/lib/mml/base/msup.rb +1 -1
- data/lib/mml/base/mtable.rb +1 -1
- data/lib/mml/base/mtd.rb +1 -1
- data/lib/mml/base/mtext.rb +6 -1
- data/lib/mml/base/mtr.rb +1 -1
- data/lib/mml/base/munder.rb +1 -3
- data/lib/mml/base/munderover.rb +1 -1
- data/lib/mml/base/semantics.rb +1 -1
- data/lib/mml/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 06746c57ed678055de388f7762532af6ee4b2c5384357d02bfe5e70b171bc978
|
|
4
|
+
data.tar.gz: cb6e5039fa287dc23cec0deb104c6f11b2916c0862d12accda17a62211adcc8c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6f323d41ded39d4f7098684c0be92c63b40fc74fa807eda838800015503760a73e08bfa4bd9601ab4a9087301f01a57b9b96376c3c3663c37cb5cee0fdd457c1
|
|
7
|
+
data.tar.gz: de5b3d389ea005d3738933e0074f0400408e6be04ff86d058a17fd9bd705bd822b4f7e1cab93ef846542a6030681535c1570b9082a87b42ab1e780aefe9f04c2
|
data/CLAUDE.md
CHANGED
|
@@ -4,70 +4,123 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|
|
4
4
|
|
|
5
5
|
## Project Overview
|
|
6
6
|
|
|
7
|
-
`mml` is a Ruby gem that provides MathML 3 and MathML 4 XML parsing and serialization. It maps MathML elements into Ruby model classes using the `lutaml-model` framework. Part of the [Plurimath](https://github.com/plurimath/mml) ecosystem.
|
|
7
|
+
`mml` is a Ruby gem that provides MathML 2, MathML 3, and MathML 4 XML parsing and serialization. It maps MathML elements into Ruby model classes using the `lutaml-model` framework. Part of the [Plurimath](https://github.com/plurimath/mml) ecosystem.
|
|
8
8
|
|
|
9
9
|
## Commands
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
rake
|
|
13
|
-
bundle exec rspec
|
|
14
|
-
bundle exec rspec spec/
|
|
15
|
-
bundle exec rspec --only-failures
|
|
16
|
-
bundle exec rubocop
|
|
17
|
-
bundle exec rubocop -a
|
|
18
|
-
bin/console
|
|
12
|
+
rake # Run specs + rubocop (default task)
|
|
13
|
+
bundle exec rspec # Run all tests
|
|
14
|
+
bundle exec rspec spec/mml/v3/msub_spec.rb:14 # Run single test by line
|
|
15
|
+
bundle exec rspec --only-failures # Previously failing tests only
|
|
16
|
+
bundle exec rubocop # Lint
|
|
17
|
+
bundle exec rubocop -a # Auto-fix lint issues
|
|
18
|
+
bin/console # IRB with gem loaded
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Versioned Architecture
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
The gem maintains **three** separate class hierarchies: `Mml::V2::` (MathML 2), `Mml::V3::` (MathML 3), and `Mml::V4::` (MathML 4). Users must reference the versioned namespace explicitly — no backward-compat aliases.
|
|
24
24
|
|
|
25
25
|
```ruby
|
|
26
|
-
Mml.parse(input)
|
|
27
|
-
Mml.parse(input, version:
|
|
28
|
-
Mml.parse(input, version:
|
|
26
|
+
Mml.parse(input) # Default: MathML 3
|
|
27
|
+
Mml.parse(input, version: 2) # MathML 2
|
|
28
|
+
Mml.parse(input, version: 3) # Explicit MathML 3
|
|
29
|
+
Mml.parse(input, version: 4) # MathML 4 with intent/arg attributes
|
|
29
30
|
```
|
|
30
31
|
|
|
31
32
|
**Directory structure:**
|
|
32
|
-
- `lib/mml/
|
|
33
|
-
- `lib/mml/v4/` —
|
|
33
|
+
- `lib/mml/base/` — version-agnostic element modules, mixed into each version's class via `include Base::XYZ`. The single source of truth for the XML mapping DSL.
|
|
34
|
+
- `lib/mml/v2/`, `lib/mml/v3/`, `lib/mml/v4/` — per-version class declarations (each ~3 lines: declare class, mix in base module, register).
|
|
34
35
|
|
|
35
|
-
**Key difference:** MathML 4 adds `intent`, `arg`, `displaystyle`, and `scriptlevel`
|
|
36
|
+
**Key difference (V3 → V4):** MathML 4 adds `intent`, `arg`, `displaystyle`, and `scriptlevel` as universal presentation attributes for accessibility markup; removes some deprecated attributes.
|
|
36
37
|
|
|
37
38
|
**No hidden delegation:** The `Mml` module does not alias or delegate constants. Use `Mml::V3::Math`, `Mml::V4::Mi`, etc. directly.
|
|
38
39
|
|
|
39
40
|
## Entry Points
|
|
40
41
|
|
|
41
|
-
- `Mml.parse(input, version: N)` — parse XML, returns `Mml::
|
|
42
|
+
- `Mml.parse(input, version: N)` — parse XML, returns `Mml::V{2,3,4}::Math` object graph
|
|
42
43
|
- `Mml::V3.parse(input)` / `Mml::V4.parse(input)` — version-specific parsing
|
|
43
44
|
- `Mml::V4::Math.from_xml(input)` — directly parse with v4 classes
|
|
44
45
|
- Call `to_xml` on any element to serialize back
|
|
45
46
|
|
|
46
|
-
## Pattern
|
|
47
|
+
## Element Mapping Pattern
|
|
47
48
|
|
|
48
|
-
Each MathML element is a `
|
|
49
|
-
- **Leaf elements** (e.g., `Mi`, `Mn`, `Mo`): use `map_content to: :value` for text content
|
|
50
|
-
- **Container elements** (e.g., `Math`, `Mrow`, `Mfrac`): use `mixed_content` to accept arbitrary child elements
|
|
49
|
+
Each MathML element is a `Lutaml::Model::Serializable` subclass with an `xml do...end` DSL block. The XML mapping lives in `lib/mml/base/<tag>.rb` as a module included into each version's class (e.g., `Mml::V3::Msub` includes `Mml::Base::Msub`).
|
|
51
50
|
|
|
52
|
-
|
|
51
|
+
### Content model — `mixed_content` vs `ordered` vs `map_content`
|
|
53
52
|
|
|
54
|
-
|
|
53
|
+
This is the most important decision when adding or editing an element. Pick based on the **schema** (see `schemas/mathml3/`, `schemas/mathml4/`, `reference-docs/mathml-source/`):
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
| Schema content model | Use | Examples |
|
|
56
|
+
|---------------------------------------------------|--------------------------------------|--------------------------------|
|
|
57
|
+
| True mixed `(#PCDATA \| mglyph \| malignmark)*` | `mixed_content` + `map_content` | `Mi`, `Mn`, `Mo`, `Ms`, `Mtext`|
|
|
58
|
+
| Element-only (`ImpliedMrow`, `<xs:sequence>`, etc.) | `ordered` | `Msub`, `Mfrac`, `Mrow`, `Math`, `Munder`, `Mfenced`, `Msgroup`, … |
|
|
59
|
+
|
|
60
|
+
**Why this matters:** lutaml-model's `each_mixed_content` iteration exposes all children to consumers (Plurimath's translator does positional indexing like `children[0]`, `children[1]` for `msub`/`mfrac`/etc.).
|
|
61
|
+
- Under `mixed_content`, whitespace between elements is yielded as a String child, shifting positional indices.
|
|
62
|
+
- Under `ordered`, whitespace-only text nodes are skipped — only elements and non-whitespace text are yielded.
|
|
63
|
+
|
|
64
|
+
If you mistakenly use `mixed_content` on an element-only schema element, downstream consumers see phantom whitespace children and silently misinterpret the tree (e.g., render `<msub><mi>t</mi><mn>90</mn></msub>` with whitespace between children as base=whitespace, sub=`<mi>t</mi>`, dropping `<mn>90</mn>`).
|
|
65
|
+
|
|
66
|
+
**Verification workflow for any element edit:**
|
|
67
|
+
```bash
|
|
68
|
+
grep -A15 'name="<tag>"' schemas/mathml3/mathml3-presentation.xsd schemas/mathml3/mathml3-common.xsd
|
|
69
|
+
grep -A3 '<tag>\s*=\s*element' schemas/mathml4/mathml4-core.rnc schemas/mathml4/mathml4-presentation.rnc
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
If the schema says `ImpliedMrow`, `MathExpression, MathExpression`, `MstackExpression*`, `TableRowExpression*`, etc. (any element-only sequence), use `ordered`. If it says `(#PCDATA | mglyph | malignmark)*`, use `mixed_content` + `map_content` + `map_element` for the inline children.
|
|
73
|
+
|
|
74
|
+
### Token elements are the only true mixed content
|
|
75
|
+
|
|
76
|
+
Per MathML schema, token elements (`mi`, `mn`, `mo`, `ms`, `mtext`) accept `(#PCDATA | mglyph | malignmark)*` — text interleaved with inline elements. They use:
|
|
77
|
+
|
|
78
|
+
```ruby
|
|
79
|
+
attribute :value, :string, collection: true # collection required for mixed_content
|
|
80
|
+
attribute :mglyph_value, :mglyph, collection: true
|
|
81
|
+
attribute :malignmark_value, :malignmark, collection: true
|
|
82
|
+
|
|
83
|
+
xml do
|
|
84
|
+
element "<tag>"
|
|
85
|
+
mixed_content
|
|
86
|
+
map_content to: :value
|
|
87
|
+
map_element "mglyph", to: :mglyph_value
|
|
88
|
+
map_element "malignmark", to: :malignmark_value
|
|
89
|
+
end
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
`value` is a `String` **collection** (Array) because text can be split by intervening inline elements (e.g., `<mi>x<malignmark/>y</mi>` → `["x", "y"]`).
|
|
93
|
+
|
|
94
|
+
### CommonAttributes
|
|
95
|
+
|
|
96
|
+
A `no_root` Lutaml model imported into container elements via `import_model`. It dynamically creates `#{tag}_value` attributes for each tag in `Configuration::SUPPORTED_TAGS`. Classes that receive it are listed in `Configuration::COMMON_ATTRIBUTES_CLASSES`.
|
|
97
|
+
|
|
98
|
+
### Per-file registration
|
|
99
|
+
|
|
100
|
+
Each `lib/mml/v{2,3,4}/<tag>.rb` ends with `Configuration.register_model(Klass, id: :tag)` so the type is registered as soon as the file is loaded (eager via `require_relative` at the bottom of each version file).
|
|
101
|
+
|
|
102
|
+
**Namespace:** All versions use the same URI (`http://www.w3.org/1998/Math/MathML`) — MathML 4 chose backward compatibility over a new namespace.
|
|
103
|
+
|
|
104
|
+
## Adapter
|
|
105
|
+
|
|
106
|
+
`Mml.default_adapter` returns `:oga` under Opal, otherwise delegates to `Lutaml::Model::Config.xml_adapter_type` (defaults to `:nokogiri`). Specs pin `:nokogiri` in `spec_helper.rb`. Users can override globally via `Lutaml::Model::Config`.
|
|
57
107
|
|
|
58
108
|
## Spec Structure
|
|
59
109
|
|
|
60
|
-
- `spec/
|
|
61
|
-
- `spec/
|
|
62
|
-
- `spec/
|
|
63
|
-
- `spec/
|
|
110
|
+
- `spec/mml/v2/`, `spec/mml/v3/`, `spec/mml/v4/` — per-version element specs (round-trip + attribute preservation)
|
|
111
|
+
- `spec/mml/v3_spec.rb`, `spec/mml/v4_spec.rb` — whole-testsuite round-trip tests against `spec/fixtures/mml3-testsuite/` and `spec/fixtures/mmlcore-testsuite/`
|
|
112
|
+
- `spec/mml/ordered_content_spec.rb` — regression specs locking in the mixed_content vs ordered distinction (whitespace handling + token element inline children)
|
|
113
|
+
- `spec/mml/adapter_configuration_spec.rb` — adapter delegation
|
|
114
|
+
- `spec/context_support_spec.rb`, `spec/lutaml_default_register_spec.rb` — registry/context behavior
|
|
115
|
+
- `spec/fixtures/mml2-testsuite/`, `mml3-testsuite/`, `mmlcore-testsuite/` — W3C test suites (submodules)
|
|
116
|
+
- `spec/fixtures/v2/`, `v4/` — version-specific fixtures
|
|
64
117
|
|
|
65
|
-
Specs use the `:
|
|
118
|
+
Specs use `canon`'s `be_xml_equivalent_to` matcher with the `:spec_friendly` profile (whitespace-tolerant). When adding a regression spec for an ordering bug, **explicitly test the inter-element-whitespace scenario** — the suite's whitespace tolerance masks positional bugs.
|
|
66
119
|
|
|
67
120
|
## Key Dependencies
|
|
68
121
|
|
|
69
|
-
- `lutaml-model` (
|
|
70
|
-
- `moxml` — XML parsing
|
|
122
|
+
- `lutaml-model` (~> 0.8.0) — data mapper framework; all element classes inherit from `Lutaml::Model::Serializable`
|
|
123
|
+
- `moxml` — XML parsing backbone (adapter selected via `Lutaml::Model::Config`)
|
|
71
124
|
- `canon` — XML comparison for specs
|
|
72
125
|
|
|
73
126
|
## Conventions
|
|
@@ -77,3 +130,10 @@ Specs use the `:nokogiri` Lutaml adapter (configured in `spec_helper.rb`). Runti
|
|
|
77
130
|
- CI workflows are auto-generated by Cimas — do not edit manually
|
|
78
131
|
- `Gemfile.lock` is gitignored; dependencies come from the gemspec
|
|
79
132
|
- Type signatures exist in `sig/mml.rbs`
|
|
133
|
+
|
|
134
|
+
## Reference Materials
|
|
135
|
+
|
|
136
|
+
- `schemas/mathml2/`, `schemas/mathml3/`, `schemas/mathml4/` — official W3C schemas (XSD for 2/3, RelaxNG for 4). **Authoritative** source for content models and attribute lists.
|
|
137
|
+
- `reference-docs/mathml-source/` — W3C spec source XML (presentation-markup.xml, validation-grammar.xml, etc.)
|
|
138
|
+
|
|
139
|
+
When deciding whether an element should have `mixed_content`, `ordered`, or `map_content`, **always** verify against the schema first.
|
data/lib/mml/base/maction.rb
CHANGED
data/lib/mml/base/math.rb
CHANGED
data/lib/mml/base/menclose.rb
CHANGED
data/lib/mml/base/merror.rb
CHANGED
data/lib/mml/base/mfenced.rb
CHANGED
|
@@ -10,16 +10,13 @@ module Mml
|
|
|
10
10
|
attribute :mathbackground, :string
|
|
11
11
|
attribute :separators, :string
|
|
12
12
|
attribute :mathcolor, :string
|
|
13
|
-
attribute :content, :string, collection: true
|
|
14
13
|
attribute :close, :string
|
|
15
14
|
attribute :open, :string
|
|
16
15
|
|
|
17
16
|
xml do
|
|
18
17
|
namespace Mml::Namespace
|
|
19
18
|
element "mfenced"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
map_content to: :content
|
|
19
|
+
ordered
|
|
23
20
|
|
|
24
21
|
map_attribute "mathbackground", to: :mathbackground
|
|
25
22
|
map_attribute "separators", to: :separators, render_empty: true
|
data/lib/mml/base/mfrac.rb
CHANGED
data/lib/mml/base/mfraction.rb
CHANGED
data/lib/mml/base/mi.rb
CHANGED
|
@@ -13,6 +13,7 @@ module Mml
|
|
|
13
13
|
attribute :mathsize, :string
|
|
14
14
|
attribute :mathvariant, :string
|
|
15
15
|
attribute :mglyph_value, :mglyph, collection: true
|
|
16
|
+
attribute :malignmark_value, :malignmark, collection: true
|
|
16
17
|
attribute :lang, :string
|
|
17
18
|
|
|
18
19
|
xml do
|
|
@@ -27,6 +28,7 @@ module Mml
|
|
|
27
28
|
map_attribute "mathvariant", to: :mathvariant
|
|
28
29
|
map_attribute "xml:lang", to: :lang
|
|
29
30
|
map_element "mglyph", to: :mglyph_value
|
|
31
|
+
map_element "malignmark", to: :malignmark_value
|
|
30
32
|
end
|
|
31
33
|
end
|
|
32
34
|
end
|
data/lib/mml/base/mlabeledtr.rb
CHANGED
data/lib/mml/base/mlongdiv.rb
CHANGED
data/lib/mml/base/mn.rb
CHANGED
|
@@ -13,6 +13,7 @@ module Mml
|
|
|
13
13
|
attribute :mathvariant, :string
|
|
14
14
|
attribute :mathsize, :string
|
|
15
15
|
attribute :mglyph_value, :mglyph, collection: true
|
|
16
|
+
attribute :malignmark_value, :malignmark, collection: true
|
|
16
17
|
|
|
17
18
|
xml do
|
|
18
19
|
namespace Mml::Namespace
|
|
@@ -25,6 +26,7 @@ module Mml
|
|
|
25
26
|
map_attribute "mathvariant", to: :mathvariant
|
|
26
27
|
map_attribute "mathsize", to: :mathsize
|
|
27
28
|
map_element "mglyph", to: :mglyph_value
|
|
29
|
+
map_element "malignmark", to: :malignmark_value
|
|
28
30
|
end
|
|
29
31
|
end
|
|
30
32
|
end
|
data/lib/mml/base/mo.rb
CHANGED
|
@@ -7,7 +7,7 @@ module Mml
|
|
|
7
7
|
# Use fully qualified names (e.g., Mml::Namespace).
|
|
8
8
|
def self.included(klass)
|
|
9
9
|
klass.class_eval do
|
|
10
|
-
attribute :value, :string
|
|
10
|
+
attribute :value, :string, collection: true
|
|
11
11
|
attribute :mathcolor, :string
|
|
12
12
|
attribute :mathbackground, :string
|
|
13
13
|
attribute :mathvariant, :string
|
|
@@ -34,11 +34,14 @@ module Mml
|
|
|
34
34
|
attribute :indentshiftfirst, :string
|
|
35
35
|
attribute :indentalignlast, :string
|
|
36
36
|
attribute :indentshiftlast, :string
|
|
37
|
+
attribute :mglyph_value, :mglyph, collection: true
|
|
38
|
+
attribute :malignmark_value, :malignmark, collection: true
|
|
37
39
|
|
|
38
40
|
# rubocop:disable Metrics/BlockLength
|
|
39
41
|
xml do
|
|
40
42
|
namespace Mml::Namespace
|
|
41
43
|
element "mo"
|
|
44
|
+
mixed_content
|
|
42
45
|
|
|
43
46
|
map_content to: :value
|
|
44
47
|
map_attribute "form", to: :form
|
|
@@ -67,6 +70,8 @@ module Mml
|
|
|
67
70
|
map_attribute "indentalignfirst", to: :indentalignfirst
|
|
68
71
|
map_attribute "indentshiftfirst", to: :indentshiftfirst
|
|
69
72
|
map_attribute "linebreakmultchar", to: :linebreakmultchar
|
|
73
|
+
map_element "mglyph", to: :mglyph_value
|
|
74
|
+
map_element "malignmark", to: :malignmark_value
|
|
70
75
|
end
|
|
71
76
|
# rubocop:enable Metrics/BlockLength
|
|
72
77
|
end
|
data/lib/mml/base/mover.rb
CHANGED
data/lib/mml/base/mpadded.rb
CHANGED
data/lib/mml/base/mphantom.rb
CHANGED
data/lib/mml/base/mroot.rb
CHANGED
data/lib/mml/base/mrow.rb
CHANGED
|
@@ -9,13 +9,11 @@ module Mml
|
|
|
9
9
|
klass.class_eval do
|
|
10
10
|
attribute :mathbackground, :string
|
|
11
11
|
attribute :mathcolor, :string
|
|
12
|
-
attribute :content, :string, collection: true
|
|
13
12
|
xml do
|
|
14
13
|
namespace Mml::Namespace
|
|
15
14
|
element "mrow"
|
|
16
|
-
|
|
15
|
+
ordered
|
|
17
16
|
|
|
18
|
-
map_content to: :content
|
|
19
17
|
map_attribute "mathcolor", to: :mathcolor
|
|
20
18
|
map_attribute "mathbackground", to: :mathbackground
|
|
21
19
|
end
|
data/lib/mml/base/ms.rb
CHANGED
|
@@ -14,6 +14,8 @@ module Mml
|
|
|
14
14
|
attribute :lquote, :string
|
|
15
15
|
attribute :rquote, :string
|
|
16
16
|
attribute :value, :string, collection: true
|
|
17
|
+
attribute :mglyph_value, :mglyph, collection: true
|
|
18
|
+
attribute :malignmark_value, :malignmark, collection: true
|
|
17
19
|
xml do
|
|
18
20
|
namespace Mml::Namespace
|
|
19
21
|
element "ms"
|
|
@@ -26,6 +28,8 @@ module Mml
|
|
|
26
28
|
map_attribute "mathvariant", to: :mathvariant
|
|
27
29
|
map_attribute "lquote", to: :lquote, render_empty: true
|
|
28
30
|
map_attribute "rquote", to: :rquote, render_empty: true
|
|
31
|
+
map_element "mglyph", to: :mglyph_value
|
|
32
|
+
map_element "malignmark", to: :malignmark_value
|
|
29
33
|
end
|
|
30
34
|
end
|
|
31
35
|
end
|
data/lib/mml/base/mscarries.rb
CHANGED
data/lib/mml/base/mscarry.rb
CHANGED
data/lib/mml/base/msgroup.rb
CHANGED
|
@@ -11,13 +11,11 @@ module Mml
|
|
|
11
11
|
attribute :mathbackground, :string
|
|
12
12
|
attribute :position, :integer
|
|
13
13
|
attribute :shift, :integer
|
|
14
|
-
attribute :msgroup_text, :string, collection: true
|
|
15
14
|
xml do
|
|
16
15
|
namespace Mml::Namespace
|
|
17
16
|
element "msgroup"
|
|
18
|
-
|
|
17
|
+
ordered
|
|
19
18
|
|
|
20
|
-
map_content to: :msgroup_text
|
|
21
19
|
map_attribute "mathcolor", to: :mathcolor
|
|
22
20
|
map_attribute "mathbackground", to: :mathbackground
|
|
23
21
|
map_attribute "position", to: :position
|
data/lib/mml/base/msqrt.rb
CHANGED
data/lib/mml/base/msrow.rb
CHANGED
data/lib/mml/base/mstack.rb
CHANGED
data/lib/mml/base/mstyle.rb
CHANGED
data/lib/mml/base/msub.rb
CHANGED
data/lib/mml/base/msubsup.rb
CHANGED
data/lib/mml/base/msup.rb
CHANGED
data/lib/mml/base/mtable.rb
CHANGED
data/lib/mml/base/mtd.rb
CHANGED
data/lib/mml/base/mtext.rb
CHANGED
|
@@ -7,21 +7,26 @@ module Mml
|
|
|
7
7
|
# Use fully qualified names (e.g., Mml::Namespace).
|
|
8
8
|
def self.included(klass)
|
|
9
9
|
klass.class_eval do
|
|
10
|
-
attribute :value, :string
|
|
10
|
+
attribute :value, :string, collection: true
|
|
11
11
|
attribute :mathcolor, :string
|
|
12
12
|
attribute :mathbackground, :string
|
|
13
13
|
attribute :mathvariant, :string
|
|
14
14
|
attribute :mathsize, :string
|
|
15
|
+
attribute :mglyph_value, :mglyph, collection: true
|
|
16
|
+
attribute :malignmark_value, :malignmark, collection: true
|
|
15
17
|
|
|
16
18
|
xml do
|
|
17
19
|
namespace Mml::Namespace
|
|
18
20
|
element "mtext"
|
|
21
|
+
mixed_content
|
|
19
22
|
|
|
20
23
|
map_content to: :value
|
|
21
24
|
map_attribute "mathcolor", to: :mathcolor
|
|
22
25
|
map_attribute "mathbackground", to: :mathbackground
|
|
23
26
|
map_attribute "mathvariant", to: :mathvariant
|
|
24
27
|
map_attribute "mathsize", to: :mathsize
|
|
28
|
+
map_element "mglyph", to: :mglyph_value
|
|
29
|
+
map_element "malignmark", to: :malignmark_value
|
|
25
30
|
end
|
|
26
31
|
end
|
|
27
32
|
end
|
data/lib/mml/base/mtr.rb
CHANGED
data/lib/mml/base/munder.rb
CHANGED
|
@@ -10,19 +10,17 @@ module Mml
|
|
|
10
10
|
attribute :mathbackground, :string
|
|
11
11
|
attribute :accentunder, :string
|
|
12
12
|
attribute :mathcolor, :string
|
|
13
|
-
attribute :content, :string, collection: true
|
|
14
13
|
attribute :align, :string
|
|
15
14
|
|
|
16
15
|
xml do
|
|
17
16
|
namespace Mml::Namespace
|
|
18
17
|
element "munder"
|
|
19
|
-
|
|
18
|
+
ordered
|
|
20
19
|
|
|
21
20
|
map_attribute "mathbackground", to: :mathbackground
|
|
22
21
|
map_attribute "accentunder", to: :accentunder
|
|
23
22
|
map_attribute "mathcolor", to: :mathcolor
|
|
24
23
|
map_attribute "align", to: :align
|
|
25
|
-
map_content to: :content
|
|
26
24
|
end
|
|
27
25
|
end
|
|
28
26
|
end
|
data/lib/mml/base/munderover.rb
CHANGED
data/lib/mml/base/semantics.rb
CHANGED
data/lib/mml/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-14 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|