Skip to content
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

Empty result for HTML entities processing in yaml2text #826

Closed
Intelligent2013 opened this issue Nov 10, 2023 · 4 comments
Closed

Empty result for HTML entities processing in yaml2text #826

Intelligent2013 opened this issue Nov 10, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Intelligent2013
Copy link
Contributor

Source issue: https://github.com/metanorma/pdfa-iso-32000-2/issues/4#issuecomment-1804659727

If the yaml file contains HTML entities like Α, then the Presentation XML doesn't contain any character.

In the sample document document.zip:

  • 1st row encoded directly without yaml2text - renders ok
  • 2nd row encoded with using of yaml2text, the entities Α and ↔ are using - empty result
  • 3rd row encoded with using of yaml2text, the entities Α and ↔ are using - renders ok
| Α | Alpha | 101 | ↔ | arrowboth | 253

{% for row in table.rows %}
{% for character in row %}
| {{ character.entity }} | {{ character.name }} | {{ character.code -}}
{% endfor %}
{% endfor %}

table.yaml:

---
id: D.5
title: Symbol set and encoding
rows:
  - - name: Alpha
      entity: "Α"
      code: 101
    - name: arrowboth
      entity: "↔"
      code: 253

  - - name: Alpha
      entity: "Α"
      code: 101
    - name: arrowboth
      entity: "↔"
      code: 253

The output Presentation XML:

<tbody>
	<tr>
		<td valign="top" align="left">Α</td>
		<td valign="top" align="left">Alpha</td>
		<td valign="top" align="left">101</td>
		<td valign="top" align="left">↔</td>
		<td valign="top" align="left">arrowboth</td>
		<td valign="top" align="left">253</td>
	</tr>
	<tr>
		<td valign="top" align="left"/>
		<td valign="top" align="left">Alpha</td>
		<td valign="top" align="left">101</td>
		<td valign="top" align="left"/>
		<td valign="top" align="left">arrowboth</td>
		<td valign="top" align="left">253</td>
	</tr>
	<tr>
		<td valign="top" align="left">Α</td>
		<td valign="top" align="left">Alpha</td>
		<td valign="top" align="left">101</td>
		<td valign="top" align="left">↔</td>
		<td valign="top" align="left">arrowboth</td>
		<td valign="top" align="left">253</td>
	</tr>
</tbody>

Resulted PDF:
image

@Intelligent2013 Intelligent2013 added the bug Something isn't working label Nov 10, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Nov 10, 2023
@opoudjis
Copy link
Contributor

Ugh.

The preprocessing that converts HTML entities into XML entities is likely happening before the preprocessing that reads in these YAML files. If so, moving it later will address this.

@opoudjis
Copy link
Contributor

Sure enough:

        preprocessor Metanorma::Standoc::EmbedIncludeProcessor
        preprocessor Metanorma::Standoc::NamedEscapePreprocessor
        preprocessor Metanorma::Standoc::LinkProtectPreprocessor
        preprocessor Metanorma::Standoc::Datamodel::AttributesTablePreprocessor
        preprocessor Metanorma::Standoc::Datamodel::DiagramPreprocessor
        preprocessor Metanorma::Plugin::Datastruct::Json2TextPreprocessor
        preprocessor Metanorma::Plugin::Datastruct::Yaml2TextPreprocessor
        preprocessor Metanorma::Plugin::Glossarist::DatasetPreprocessor

@opoudjis
Copy link
Contributor

I can't test this, so I'm asking you to, @Intelligent2013

@Intelligent2013
Copy link
Contributor Author

@opoudjis it's working as expected now. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants