ooxml_parser 0.12.1 → 0.12.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36954aec83ece68abe869fbdacc1eb46f3324ca2220fa1309480ac58c1d7a30e
|
4
|
+
data.tar.gz: aa146d19ad2d1791d435be68b2d13bf4f601fbea14856cd880c292c269d3fc77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d024e15631968da836ad38f32316f52eb87a9aa924cbb7240ea445162679799ce4cfc85183122e07fdc8a501b34efde6a6c3d38d179b7fd7ee12fd5e17a95693
|
7
|
+
data.tar.gz: e97ac2cff7f7db1f93e79bff2b7110db0c78a748f396337ac851369c799001eb9779762324dfa7c177a9583905cd435db2ba507caab7faf41a5a980e66a0f31c
|
@@ -3,6 +3,7 @@
|
|
3
3
|
require_relative 'paragrpah_properties/numbering_properties'
|
4
4
|
require_relative 'paragrpah_properties/paragraph_borders'
|
5
5
|
require_relative 'paragrpah_properties/paragraph_spacing'
|
6
|
+
require_relative 'paragrpah_properties/paragraph_stlye_ref'
|
6
7
|
require_relative 'paragrpah_properties/spacing'
|
7
8
|
require_relative 'paragrpah_properties/tabs'
|
8
9
|
module OoxmlParser
|
@@ -17,6 +18,8 @@ module OoxmlParser
|
|
17
18
|
attr_accessor :run_properties
|
18
19
|
# @return [Borders] borders of paragraph
|
19
20
|
attr_accessor :paragraph_borders
|
21
|
+
# @return [ParagraphStyleRef] Referenced Paragraph Style
|
22
|
+
attr_accessor :paragraph_style_ref
|
20
23
|
# @return [True, False] Specifies that the paragraph
|
21
24
|
# (or at least part of it) should be rendered on
|
22
25
|
# the same page as the next paragraph when possible
|
@@ -84,6 +87,8 @@ module OoxmlParser
|
|
84
87
|
@run_properties = RunProperties.new(parent: self).parse(node_child)
|
85
88
|
when 'pBdr'
|
86
89
|
@paragraph_borders = ParagraphBorders.new(parent: self).parse(node_child)
|
90
|
+
when 'pStyle'
|
91
|
+
@paragraph_style_ref = ParagraphStyleRef.new(parent: self).parse(node_child)
|
87
92
|
when 'keepNext'
|
88
93
|
@keep_next = true
|
89
94
|
when 'sectPr'
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module OoxmlParser
|
4
|
+
# Class for parsing `pStyle` tags
|
5
|
+
class ParagraphStyleRef < OOXMLDocumentObject
|
6
|
+
# @return [Integer] value of ParagraphStyleRef
|
7
|
+
attr_reader :value
|
8
|
+
|
9
|
+
# Parse ParagraphStyleRef object
|
10
|
+
# @param node [Nokogiri::XML:Element] node to parse
|
11
|
+
# @return [ParagraphStyleRef] result of parsing
|
12
|
+
def parse(node)
|
13
|
+
node.attributes.each do |key, value|
|
14
|
+
case key
|
15
|
+
when 'val'
|
16
|
+
@value = value.value.to_s
|
17
|
+
end
|
18
|
+
end
|
19
|
+
self
|
20
|
+
end
|
21
|
+
|
22
|
+
# @return [ParagraphStyle] which was referenced
|
23
|
+
def referenced_style
|
24
|
+
root_object.document_style_by_id(value)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
data/lib/ooxml_parser/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ooxml_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.12.
|
4
|
+
version: 0.12.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ONLYOFFICE
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-02-
|
13
|
+
date: 2021-02-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: nokogiri
|
@@ -321,6 +321,7 @@ files:
|
|
321
321
|
- lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/numbering_properties.rb
|
322
322
|
- lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_borders.rb
|
323
323
|
- lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_spacing.rb
|
324
|
+
- lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/paragraph_stlye_ref.rb
|
324
325
|
- lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing.rb
|
325
326
|
- lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/spacing/line_spacing.rb
|
326
327
|
- lib/ooxml_parser/common_parser/common_data/paragraph/paragrpah_properties/tabs.rb
|