require "spec_helper"
RSpec.describe IsoDoc do
it "processes amend blocks" do
input = <<~INPUT
Document title
en
published
2020
article
Change Clause
2
A.7
This table contains information on polygon cells which are not
included in ISO 10303-52. Remove table 2 completely and replace
with:
Edges of triangle and quadrilateral cells
triangle |
quadrilateral |
edge |
vertices |
edge |
vertices |
1 |
1, 2 |
1 |
1, 2 |
2 |
2, 3 |
2 |
2, 3 |
3 |
3, 1 |
3 |
3, 4 |
|
|
4 |
4, 1 |
This is not generalised further.
INPUT
presxml = <<~OUTPUT
Document title
en
published
2020
article
1.Change Clause
This table contains information on polygon cells which are not
included in ISO 10303-52. Remove table 2 completely and replace
with:
Table 2 — Edges of triangle and quadrilateral cells
triangle |
quadrilateral |
edge |
vertices |
edge |
vertices |
1 |
1, 2 |
1 |
1, 2 |
2 |
2, 3 |
2 |
2, 3 |
3 |
3, 1 |
3 |
3, 4 |
|
|
4 |
4, 1 |
EXAMPLE A.7
This is not generalised further.
OUTPUT
html = <<~OUTPUT
Document title
1. Change Clause
This table contains information on polygon cells which are not
included in ISO 10303-52. Remove table 2 completely and replace
with:
Table 2 — Edges of triangle and quadrilateral cells
triangle |
quadrilateral |
edge |
vertices |
edge |
vertices |
1 |
1, 2 |
1 |
1, 2 |
2 |
2, 3 |
2 |
2, 3 |
3 |
3, 1 |
3 |
3, 4 |
|
|
4 |
4, 1 |
EXAMPLE A.7
This is not generalised further.
OUTPUT
expect(xmlpp(IsoDoc::PresentationXMLConvert.new({})
.convert("test", input, true))
.sub(%r{