Fix processing errors for data objects #3306
Merged
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.
Signed-off-by: Robert D Anderson robander@us.ibm.com
Description
Fixes two issues with processing for
object
elements:object/@data
, we set a default offormat="html"
in our job configuration. Out of the box DITA-OT 3.3.1 treats anything referenced withformat="html"
as lightweight DITA, and tries to parse the file, so we automatically parse (and presumably fail) on any local media object referenced byobject/@data
. To fix this, I've changed the default format for media objects fromhtml
tonondita
, which still copies it to the output directory but avoids trying to parse it for any HTML processing. Tested with<object data="local-video.mp4"/>
which results in failures fromhtml2dita.xsl
@data
as a local file. The way I see to work around this is by moving the value to a key and using@datakeyref
but that should not be necessary - we should recognize that the URL is absolute and avoid treating it as a local (html) file. If theorg.lwdita
plugin is disabled so that we do not try and parse the file, it still fails later when we try to copy this as a local HTML file. To correct this, I've added a test forattrValue.isAbsolute()
which avoids further processing of the@data
target when it is an absolute reference. Tested with the following, which also fails inhtml2dita.xsl
:<object data="https://www.youtube.com/embed/BaUjhYw8IK4">
Motivation and Context
Ran in to both of these failures with DITA-OT 3.3.1 and
object
elements.How Has This Been Tested?
Tested with each of the values above. Zip file:
object.zip
Type of Changes