3 Commits
Author SHA1 Message Date
mathias234 9d17209bc8 Update version to 0.0.9
CI Pipeline / build (push) Successful in 12s
2026-10-08 14:54:57 +02:00
mathias234 a84d7b0b8f Merge pull request 'Fix bullet lists in desktop Word' (#11) from fix/word-desktop-list-numbering into main
CI Pipeline / build (push) Successful in 13s
Reviewed-on: #11
2026-10-08 12:52:35 +00:00
mathias234 022c52eef6 fix: Preserve bullet lists in desktop Word
CI Pipeline / build (pull_request) Successful in 35s
2026-10-08 14:50:22 +02:00
3 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
module Notare module Notare
VERSION = "0.0.8" VERSION = "0.0.9"
end end
+10 -5
View File
@@ -16,11 +16,8 @@ module Notare
xml.numbering("xmlns:w" => NAMESPACE) do xml.numbering("xmlns:w" => NAMESPACE) do
xml.parent.namespace = xml.parent.namespace_definitions.find { |ns| ns.prefix == "w" } xml.parent.namespace = xml.parent.namespace_definitions.find { |ns| ns.prefix == "w" }
@lists.each do |list| render_abstract_nums(xml)
render_abstract_num(xml, list) render_nums(xml)
render_num(xml, list)
end
end end
end end
builder.to_xml builder.to_xml
@@ -28,6 +25,14 @@ module Notare
private private
def render_abstract_nums(xml)
@lists.each { |list| render_abstract_num(xml, list) }
end
def render_nums(xml)
@lists.each { |list| render_num(xml, list) }
end
def render_abstract_num(xml, list) def render_abstract_num(xml, list)
xml["w"].abstractNum("w:abstractNumId" => list.num_id.to_s) do xml["w"].abstractNum("w:abstractNumId" => list.num_id.to_s) do
9.times do |level| 9.times do |level|
+4
View File
@@ -115,6 +115,10 @@ class ListTest < Minitest::Test
assert_includes doc_xml, "List 1 Item 1" assert_includes doc_xml, "List 1 Item 1"
assert_includes doc_xml, "List 2 Item 1" assert_includes doc_xml, "List 2 Item 1"
assert_includes doc_xml, "Separator paragraph" assert_includes doc_xml, "Separator paragraph"
numbering_xml = Nokogiri::XML(xml_files["word/numbering.xml"])
child_names = numbering_xml.root.element_children.map(&:name)
assert_equal %w[abstractNum abstractNum num num], child_names
end end
def test_mixed_list_types def test_mixed_list_types