Implement many more nodes
All checks were successful
CI Pipeline / build (pull_request) Successful in 12s

Adds these new styling and formatting nodes
* strike
* highlight
* linebreaks
* pagebreaks
* Hyperlinks
This commit is contained in:
2025-12-02 14:43:53 +01:00
parent 243b06d8f8
commit 597bc91c40
19 changed files with 788 additions and 24 deletions

View File

@@ -133,4 +133,49 @@ class FormattingTest < Minitest::Test
assert_includes xml, "bold+italic "
assert_includes xml, "all three"
end
def test_strikethrough_text
xml = create_doc_and_read_xml do |doc|
doc.p do
doc.s { doc.text "strikethrough text" }
end
end
assert_includes xml, "<w:strike/>"
assert_includes xml, "strikethrough text"
end
def test_strikethrough_with_other_formatting
xml = create_doc_and_read_xml do |doc|
doc.p do
doc.b do
doc.s { doc.text "bold and strikethrough" }
end
end
end
assert_includes xml, "<w:b/>"
assert_includes xml, "<w:strike/>"
assert_includes xml, "bold and strikethrough"
end
def test_all_four_formatting_options
xml = create_doc_and_read_xml do |doc|
doc.p do
doc.b do
doc.i do
doc.u do
doc.s { doc.text "all four" }
end
end
end
end
end
assert_includes xml, "<w:b/>"
assert_includes xml, "<w:i/>"
assert_includes xml, '<w:u w:val="single"/>'
assert_includes xml, "<w:strike/>"
assert_includes xml, "all four"
end
end