mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Add p element to docx list allowed elements [SCI-5461]
This commit is contained in:
parent
dbf4a5804a
commit
e206892864
1 changed files with 2 additions and 2 deletions
|
@ -148,7 +148,7 @@ module Reports
|
|||
end
|
||||
|
||||
def list_element(list_element)
|
||||
allowed_elements = %w(li ul ol a img strong em h1 h2 h2 h3 h4 h5 span)
|
||||
allowed_elements = %w(li ul ol a img strong em h1 h2 h2 h3 h4 h5 span p)
|
||||
data_array = list_element.children.select { |n| allowed_elements.include?(n.name) }.map do |li_child|
|
||||
li_child.children.map do |item|
|
||||
if item.is_a? Nokogiri::XML::Text
|
||||
|
@ -161,7 +161,7 @@ module Reports
|
|||
img_element(item)&.merge(bookmark_id: SecureRandom.hex)
|
||||
elsif %w(table).include?(item.name)
|
||||
tiny_mce_table_element(item).merge(bookmark_id: SecureRandom.hex)
|
||||
elsif %w(strong em h1 h2 h2 h3 h4 h5 span).include?(item.name)
|
||||
elsif %w(strong em h1 h2 h2 h3 h4 h5 span p).include?(item.name)
|
||||
# Pass styles and extend renderer for li with style, some limitations on li items
|
||||
# { type: 'text', value: item[:value], style: paragraph_styling(item) }
|
||||
item.children.text
|
||||
|
|
Loading…
Reference in a new issue