-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated ruby: https://github.com/metanorma/metanorma-standoc/issues/73 #555
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
23ffa34
Updated ruby: https://github.com/metanorma/metanorma-standoc/issues/73
opoudjis 87736ff
Updated ruby: https://github.com/metanorma/metanorma-standoc/issues/73
opoudjis a7459c0
Updated ruby: https://github.com/metanorma/metanorma-standoc/issues/73
opoudjis 94e5bc3
Updated ruby: https://github.com/metanorma/metanorma-standoc/issues/73
opoudjis 26d8fd9
Updated ruby: https://github.com/metanorma/metanorma-standoc/issues/73
opoudjis 0b50f31
Updated ruby: https://github.com/metanorma/metanorma-standoc/issues/73
opoudjis 38299ad
Updated ruby: https://github.com/metanorma/metanorma-standoc/issues/73
opoudjis 08f0d10
rspec
opoudjis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
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
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
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
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
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
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 |
---|---|---|
|
@@ -1978,4 +1978,76 @@ | |
expect(xmlpp(IsoDoc::PresentationXMLConvert.new(presxml_options) | ||
.convert("test", input, true))).to be_equivalent_to xmlpp(output) | ||
end | ||
|
||
it "processes ruby markup" do | ||
input = <<~INPUT | ||
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="semantic"> | ||
<preface> | ||
<foreword id="A"> | ||
<p> | ||
<ruby><pronunciation value="とうきょう"/>東京</ruby> | ||
<ruby><pronunciation value="とうきょう" lang="ja" script="Hira"/>東京</ruby> | ||
<ruby><pronunciation value="Tōkyō" script="Latn"/>東京</ruby> | ||
<ruby><annotation value="ライバル"/>親友</ruby> | ||
<ruby><pronunciation value="とう"/>東</ruby> <ruby><pronunciation value="きょう"/>京</ruby> | ||
<ruby><pronunciation value="Tō" script="Latn"/>東</ruby><ruby><pronunciation value="kyō" script="Latn"/>京</ruby> | ||
|
||
|
||
<ruby><pronunciation value="とう"/><ruby><pronunciation value="tou"/>東</ruby></ruby> <ruby><pronunciation value="なん"/><ruby><pronunciation value="nan"/>南</ruby></ruby> の方角 | ||
<ruby><pronunciation value="たつみ"/><ruby><pronunciation value="とう"/>東</ruby><ruby><pronunciation value="なん"/>南</ruby></ruby> | ||
<ruby><pronunciation value="プロテゴ"/><ruby><pronunciation value="まも"/>護</ruby>れ</ruby>! | ||
<ruby><pronunciation value="プロテゴ"/>れ<ruby><pronunciation value="まも"/>護</ruby></ruby>!</p> | ||
</p> | ||
</foreword></preface></standard-document> | ||
INPUT | ||
presxml = <<~OUTPUT | ||
<standard-document xmlns="https://www.metanorma.org/ns/standoc" type="presentation"> | ||
<preface><clause type="toc" id="_" displayorder="1"><title depth="1">Table of contents</title></clause> | ||
<foreword id="A" displayorder="2"> | ||
<p> | ||
<ruby><rb>東京</rb><rt>とうきょう</rt></ruby><ruby><rb>東京</rb><rt>とうきょう</rt></ruby><ruby><rb>東京</rb><rt>Tōkyō</rt></ruby><ruby><rb>親友</rb><rt>ライバル</rt></ruby><ruby><rb>東</rb><rt>とう</rt></ruby><ruby><rb>京</rb><rt>きょう</rt></ruby><ruby><rb>東</rb><rt>Tō</rt></ruby><ruby><rb>京</rb><rt>kyō</rt></ruby><ruby><rb><ruby><rb>東</rb><rt>tou</rt></ruby></rb><rt>とう</rt></ruby><ruby><rb><ruby><rb>南</rb><rt>nan</rt></ruby></rb><rt>なん</rt></ruby> の方角 | ||
<ruby><rb><ruby><rb>東</rb><rt>とう</rt></ruby><ruby><rb>南</rb><rt>なん</rt></ruby></rb><rt>たつみ</rt></ruby> | ||
<ruby><rb><ruby><rb>護</rb><rt>まも</rt></ruby>れ</rb><rt>プロテゴ</rt></ruby>! | ||
<ruby><rb>れ<ruby><rb>護</rb><rt>まも</rt></ruby></rb><rt>プロテゴ</rt></ruby>!</p> | ||
</p> | ||
</foreword> | ||
</preface> | ||
</standard-document> | ||
OUTPUT | ||
html = <<~OUTPUT | ||
#{HTML_HDR} | ||
<br/> | ||
<div id="A"> | ||
<h1 class="ForewordTitle">Foreword</h1> | ||
<p><ruby><rb>東京</rb><rt>とうきょう</rt></ruby><ruby><rb>東京</rb><rt>とうきょう</rt></ruby><ruby><rb>東京</rb><rt>Tōkyō</rt></ruby><ruby><rb>親友</rb><rt>ライバル</rt></ruby><ruby><rb>東</rb><rt>とう</rt></ruby><ruby><rb>京</rb><rt>きょう</rt></ruby><ruby><rb>東</rb><rt>Tō</rt></ruby><ruby><rb>京</rb><rt>kyō</rt></ruby><ruby><rb><ruby><rb>東</rb><rt>tou</rt></ruby></rb><rt>とう</rt></ruby><ruby><rb><ruby><rb>南</rb><rt>nan</rt></ruby></rb><rt>なん</rt></ruby> の方角 | ||
<ruby><rb><ruby><rb>東</rb><rt>とう</rt></ruby><ruby><rb>南</rb><rt>なん</rt></ruby></rb><rt>たつみ</rt></ruby> | ||
<ruby><rb><ruby><rb>護</rb><rt>まも</rt></ruby>れ</rb><rt>プロテゴ</rt></ruby>! | ||
<ruby><rb>れ<ruby><rb>護</rb><rt>まも</rt></ruby></rb><rt>プロテゴ</rt></ruby>!</p> | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
OUTPUT | ||
doc = <<~OUTPUT | ||
<div> | ||
<h1 class="ForewordTitle">Foreword</h1> | ||
<p><ruby><rb>東京</rb><rt style="font-size: 6pt;">とうきょう</rt></ruby><ruby><rb>東京</rb><rt style="font-size: 6pt;">とうきょう</rt></ruby><ruby><rb>東京</rb><rt style="font-size: 6pt;">Tōkyō</rt></ruby><ruby><rb>親友</rb><rt style="font-size: 6pt;">ライバル</rt></ruby><ruby><rb>東</rb><rt style="font-size: 6pt;">とう</rt></ruby><ruby><rb>京</rb><rt style="font-size: 6pt;">きょう</rt></ruby><ruby><rb>東</rb><rt style="font-size: 6pt;">Tō</rt></ruby><ruby><rb>京</rb><rt style="font-size: 6pt;">kyō</rt></ruby><ruby><rb>東</rb><rt style="font-size: 6pt;">とう</rt></ruby>(tou)<ruby><rb>南</rb><rt style="font-size: 6pt;">なん</rt></ruby>(nan) の方角 | ||
<ruby><rb>東</rb><rt style="font-size: 6pt;">たつみ</rt></ruby>(とう) | ||
<ruby><rb>護</rb><rt style="font-size: 6pt;">プロテゴ</rt></ruby>(まも)! | ||
<ruby><rb>護</rb><rt style="font-size: 6pt;">プロテゴ</rt></ruby>(まも)!</p> | ||
</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing whitespace detected. |
||
OUTPUT | ||
expect(xmlpp(strip_guid(IsoDoc::PresentationXMLConvert | ||
.new(presxml_options.merge(output_formats: { html: "html", doc: "doc" })) | ||
.convert("test", input, true)) | ||
.sub(%r{<metanorma-extension>.*</metanorma-extension>}m, "") | ||
.sub(%r{<localized-strings>.*</localized-strings>}m, ""))) | ||
.to be_equivalent_to xmlpp(presxml) | ||
expect(xmlpp(IsoDoc::HtmlConvert.new({}) | ||
.convert("test", presxml, true))).to be_equivalent_to xmlpp(html) | ||
expect(xmlpp(IsoDoc::WordConvert.new({}) | ||
.convert("test", presxml, true) | ||
.sub(/^.*<h1/m, "<div><h1").sub(%r{</div>.*$}m, "</div>"))) | ||
.to be_equivalent_to xmlpp(doc) | ||
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use 2 spaces for indentation in a heredoc.