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

Properly support <img> tags in OSCAL markup block elements #1132

Closed
david-waltermire opened this issue Feb 8, 2022 · 9 comments
Closed

Properly support <img> tags in OSCAL markup block elements #1132

david-waltermire opened this issue Feb 8, 2022 · 9 comments
Assignees
Labels
Milestone

Comments

@david-waltermire
Copy link
Contributor

Describe the bug

Block elements in OSCAL markup should support HTML img tags, but the OSCAL XML schemas do not allow this.

Who is the bug affecting?

Anyone trying to use tags.

What is affected by this bug?

All users of OSCAL XML Schemas.

When does this occur?

The following example illustrates this problem.

basic-catalog-img.zip

How do we replicate the issue?

Run a validation against the example provided above.

Expected behavior (i.e. solution)

The attached content should validate.

@aj-stein-nist
Copy link
Contributor

This seems like a good learning experience, @david-waltermire-nist . Since this is a confirmed bug, can I volunteer to work on this one and write a fix to get up to speed on how to make core changes to Metaschema?

@wendellpiez
Copy link
Contributor

What does the offending markup look like?

Assuming it is something like this:

<p>My text is here.</p>
<img alt="image alt text" src="boo.svg"/>
<p>More text here.</p>

and not just (currently valid):

<p>My text is here.</p>
<p><img alt="image alt text" src="boo.svg"/></p>
<p>More text here.</p>

How do markdown processors handle naked images? We should arguably conform with common practice.

BTW this does raise issues about backward compatibility since solo images appearing at block level make the same Markdown as solo images inside paragraphs:

My text is here.

![image alt text](boo.svg)

More text here.

Both forms of markup convert to this (with and without <p>, but only one can come back from conversion.

@david-waltermire david-waltermire added this to the OSCAL 1.0.2 milestone Feb 10, 2022
@david-waltermire
Copy link
Contributor Author

david-waltermire commented Feb 25, 2022

@aj-stein-nist I fixed this while working in the prose module to support metaschema-java XSD generation. Let's find another way for you to learn more about working on Metaschema internals.

I am working with @wendellpiez to make sure these changes do not disrupt the XSLT-based XSD generation.

@aj-stein-nist
Copy link
Contributor

@aj-stein-nist I fixed this while working in the prose module to support metaschema-java XSD generation. Let's find another way for you to learn more about working on Metaschema internals.

I am working with @wendellpiez to make sure these changes do not disrupt the XSLT-based XSD generation.

Oh I see what you did there with the prose module. I now understand the goal of the changes now that you added this, looks good!

@david-waltermire
Copy link
Contributor Author

A PR is still needed to upgrade OSCAL to use the latest Metaschema submodule once the Metaschema code is merged.

@david-waltermire
Copy link
Contributor Author

@wendellpiez is testing the metaschema changes. We will post a PR once this is completed.

@david-waltermire
Copy link
Contributor Author

david-waltermire commented Mar 3, 2022

Discussed this on the NIST team status call. In our flavor of Markdown, images may only appear in paragraph or other blocks. It is important to maintain parity between our HTML and Markdown use. We should remove the support for paragraphs at the block level to maintain this parity.

david-waltermire added a commit to usnistgov/metaschema that referenced this issue Mar 5, 2022
* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
david-waltermire added a commit to david-waltermire/metaschema-java-old that referenced this issue Mar 7, 2022
@david-waltermire
Copy link
Contributor Author

This work requires usnistgov/metaschema#191, which won't be ready until OSCAL 1.1. Moving the milestone accordingly.

david-waltermire added a commit to usnistgov/metaschema that referenced this issue Mar 20, 2022
* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
@david-waltermire
Copy link
Contributor Author

Issue #195 covers the follow on work to implement this in the XSLT implementation.

david-waltermire added a commit to usnistgov/metaschema-java that referenced this issue Apr 15, 2022
* Implemented JSON schema generation. Resolves usnistgov/OSCAL#1145. Resolves usnistgov/OSCAL#1132. Resolves usnistgov/OSCAL#1131. Resolves usnistgov/OSCAL#1003.
* Improved JSON schema generation. Worked out unicode support for JSON and XSD. Resolves usnistgov/OSCAL#1127. Resolves usnistgov/OSCAL#956.
* Fixed bugs in DateAdapter causing dates without timezones to not parse or write properly.
* Refactored and moved validation API to metaschema-model-common.
* Fixed a bug in write operations causing some file contents to not be truncated when overwriting files. Added StandardOpenOption.TRUNCATE_EXISTING to write operations.
* Fixed a bug in array writing for properties using in-json=ARRAY or SINGLETON_OR_ARRAY, that caused an error related to the closing array syntax.
* Refactored Java class generation to provide more information to the caller about generated classes.
* Added dynamic test support for Metaschema-based testing in a new module metaschema-testing.
* Updated JSON parsing code to be more resilient.
* Updated to new metaschema feature branch for major refactor.
* Schema generation refactor, focusing on XML and JSON alignment.
* Fixed some compiler, PMD, and checkstyle warnings. Making incremental progress towards getting these cleaned up.
* Simplified and removed some unneeded interfaces and abstract classes. Reducing public/protected classes and methods.
* Fixed bugs around inline type handling in schema generation.
* Migrated the metaschema-java-binding-annotations module sources to metaschema-java-binding.
* Completed full support for Metaschema information in bound Java classes.
* Refactored function library, adding functions for abs, boolean, ceiling, compare, data, floor, and round. Identified all functions that need to be implemented eventually.
* Added some Javadocs.
* Fixing relative path in POM causing build errors in CI.
david-waltermire added a commit to usnistgov/metaschema that referenced this issue Apr 28, 2022
* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
david-waltermire added a commit to usnistgov/metaschema that referenced this issue Jun 21, 2022
* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
david-waltermire added a commit to usnistgov/metaschema that referenced this issue Dec 7, 2022
* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
aj-stein-nist pushed a commit to aj-stein-nist/metaschema that referenced this issue Jan 9, 2023
)

* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
aj-stein-nist pushed a commit to aj-stein-nist/metaschema that referenced this issue Jan 10, 2023
)

* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
aj-stein-nist pushed a commit to aj-stein-nist/metaschema that referenced this issue Jan 10, 2023
)

* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
aj-stein-nist pushed a commit to aj-stein-nist/metaschema that referenced this issue Jan 10, 2023
)

* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
aj-stein-nist pushed a commit to aj-stein-nist/metaschema that referenced this issue Jan 10, 2023
)

* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
aj-stein-nist pushed a commit to aj-stein-nist/metaschema that referenced this issue Jan 10, 2023
)

* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
david-waltermire added a commit to usnistgov/metaschema that referenced this issue Mar 9, 2023
* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
nikitawootten-nist pushed a commit to nikitawootten-nist/metaschema-xslt that referenced this issue Jul 21, 2023
* refactored markup use in the Metaschema XSD to make use of the oscal-prose-module.xsd
* Refactored prose module to allow img tags in markup. Resolves usnistgov/OSCAL#1132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants