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
In the case of comments, if the user includes --> as text, we obviously have a problem if we "fix" this issue. Perhaps we can escape only those. Similarly, in RAWTEXT of a style tag, we may have to handle </style>.
Rather than fixing this immediately in TyXML, I propose that before TyXML 4.0,
I split up Markup.ml into subpackages, or aliased modules, one of which will include the HTML writer, but exclude any other writers or parsers,
I add a polyglot output mode to Markup.ml,
Markup.ml (IIRC) already properly doesn't escape the above fragments, but we decide what to do about --> in comments, etc., and do it, or support doing it, in Markup.ml,
we use Markup.ml's HTML writer to do the HTML writing.
This will leave us with only one place at which to maintain conformance with HTML5 and XHTML. It will add Markup.ml as a run-time dependency to projects using TyXML (as opposed to only build-time with the PPX). The split of Markup.ml into packages or aliased submodules should prevent the linking of unnecessary code into users' programs, such as the enormous HTML5 parser.
The text was updated successfully, but these errors were encountered:
It will add Markup.ml as a run-time dependency to projects using TyXML
This may not be true, Tyxml is currently split between the functor part and the concrete implementation. I have no problem adding dependencies to the concrete implementation (especially a printer) since it's not used inside eliom and js_of_ocaml.
Regarding Unsafe.data, I think the issue is a bit more complicated. For example, in a stylesheet, the text </style> is not allowed. So, if it is present, it should be escaped. Everything else is tokenized literally (no entity or character references).
Also, if Unsafe.data (or some other function) should be used for script or stylesheet data, the PPX should emit that instead of pcdata in the AST.
See the specification for serialization.
However, this program
produces this output:
In particular, this seems to prevent comments such as:
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
being generated by expressions such as
(credit to @sgrove for a query).
In the case of comments, if the user includes
-->
as text, we obviously have a problem if we "fix" this issue. Perhaps we can escape only those. Similarly, in RAWTEXT of astyle
tag, we may have to handle</style>
.Rather than fixing this immediately in TyXML, I propose that before TyXML 4.0,
-->
in comments, etc., and do it, or support doing it, in Markup.ml,This will leave us with only one place at which to maintain conformance with HTML5 and XHTML. It will add Markup.ml as a run-time dependency to projects using TyXML (as opposed to only build-time with the PPX). The split of Markup.ml into packages or aliased submodules should prevent the linking of unnecessary code into users' programs, such as the enormous HTML5 parser.
The text was updated successfully, but these errors were encountered: