Class: Uniword::Validation::Rules::TableGridRule
- Inherits:
-
ModelRule
show all
- Defined in:
- lib/uniword/validation/rules/table_grid_rule.rb
Overview
DOC-204: every table must have a tblGrid.
wml.xsd CT_Tbl requires exactly one tblGrid child; without it
Word cannot lay out column widths and repairs the document.
Instance Method Summary
collapse
Methods inherited from ModelRule
#context_type
Methods inherited from Base
#applicable?, #context_type, #description, #validity_rule
Instance Method Details
#category ⇒ Object
12
|
# File 'lib/uniword/validation/rules/table_grid_rule.rb', line 12
def category = :tables
|
#check(context) ⇒ Object
15
16
17
18
19
20
21
22
23
|
# File 'lib/uniword/validation/rules/table_grid_rule.rb', line 15
def check(context)
context.document.tables.each_with_index.filter_map do |table, idx|
next if table.grid
issue("Table #{idx + 1} is missing the required tblGrid element",
part: "word/document.xml",
suggestion: "Add a w:tblGrid with one w:gridCol per column.")
end
end
|
#code ⇒ Object
11
|
# File 'lib/uniword/validation/rules/table_grid_rule.rb', line 11
def code = "DOC-204"
|
#severity ⇒ Object
13
|
# File 'lib/uniword/validation/rules/table_grid_rule.rb', line 13
def severity = "error"
|