-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #302 from metanorma/features/white-paper
White paper rendering: https://github.com/metanorma/metanorma-ieee/is…
- Loading branch information
Showing
36 changed files
with
12,799 additions
and
1,503 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require "html2doc/ieee_wp/lists" | ||
|
||
class Html2Doc | ||
class IEEE_WP | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class Html2Doc | ||
class IEEE_WP < ::Html2Doc | ||
def list2para(list) | ||
list.name == "ol" and return super | ||
return if list.xpath("./li").empty? | ||
|
||
list.xpath("./li/p").each do |p| | ||
p["class"] ||= "BulletedList" | ||
end | ||
list.xpath("./li").each do |l| | ||
l.name = "p" | ||
l["class"] ||= "BulletedList" | ||
next unless l.first_element_child&.name == "p" | ||
|
||
l["style"] ||= "" | ||
l["style"] += (l.first_element_child["style"]&.sub(/mso-list[^;]+;/, "") || "") | ||
l.first_element_child.replace(l.first_element_child.children) | ||
end | ||
list.replace(list.children) | ||
end | ||
end | ||
end |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.