You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These DocumentAttributeDeclaration, DocumentAttributeSubstitution and DocumentAttributeReset must be in the DraftDocument but stripped of the "final' Document. If a document attribute cannot be substituted (because there is not such attribute defined), then the result should be a corresponding StringElement with a content set to {name} (where name is the name of the attribute to substitute).
Also, since the DocumentAttributeDeclaration elements will be removed from the "final document", we need to generate the element IDs during the parsing, not during the rendering.
The text was updated successfully, but these errors were encountered:
xcoulon
changed the title
Remove DocumentAttributeSubstitution elements in the document after parsing
Remove DocumentAttributeDeclaration/Substitution/Reset elements in the document after parsing
Dec 22, 2019
xcoulon
added a commit
to xcoulon/libasciidoc
that referenced
this issue
Dec 28, 2019
Once the draft document has been parsed, there should be no
DocumentAttributeSubstitution element left. If an attribute was not
declared, then it should have been replaced with its string equivalent
({name})
Fixesbytesparadise#444
Signed-off-by: Xavier Coulon <[email protected]>
xcoulon
added a commit
to xcoulon/libasciidoc
that referenced
this issue
Dec 28, 2019
DocumentAttributeDeclaration, Substitution and Reset
blocks are processed while preparing the final
document.
As a consequence, final document is simpler to render,
but more processing needs to take place beforehand,
including the section id generation, the implicit usage of
the 'imagesdir' attribute while generating the image
location and the marker for the table of contents.
fixesbytesparadise#444
Signed-off-by: Xavier Coulon <[email protected]>
xcoulon
added a commit
to xcoulon/libasciidoc
that referenced
this issue
Dec 28, 2019
DocumentAttributeDeclaration, Substitution and Reset
blocks are processed while preparing the final
document.
As a consequence, final document is simpler to render,
but more processing needs to take place beforehand,
including the section id generation, the implicit usage of
the 'imagesdir' attribute while generating the image
location and the marker for the table of contents.
If an attribute was not declared and could not be sustituted, then
it is replace with its name surrounded by curly brackets.
fixesbytesparadise#444
Signed-off-by: Xavier Coulon <[email protected]>
* refactor(parser): apply attribute substitutions in final Document
DocumentAttributeDeclaration, Substitution and Reset
blocks are processed while preparing the final
document.
As a consequence, final document is simpler to render,
but more processing needs to take place beforehand,
including the section id generation, the implicit usage of
the 'imagesdir' attribute while generating the image
location and the marker for the table of contents.
If an attribute was not declared and could not be sustituted, then
it is replace with its name surrounded by curly brackets.
also, removed some unused funcs
fixes#444
Signed-off-by: Xavier Coulon <[email protected]>
These
DocumentAttributeDeclaration
,DocumentAttributeSubstitution
andDocumentAttributeReset
must be in theDraftDocument
but stripped of the "final' Document. If a document attribute cannot be substituted (because there is not such attribute defined), then the result should be a correspondingStringElement
with a content set to{name}
(wherename
is the name of the attribute to substitute).Also, since the DocumentAttributeDeclaration elements will be removed from the "final document", we need to generate the element IDs during the parsing, not during the rendering.
The text was updated successfully, but these errors were encountered: