SMW::off and SMW::on markers
This page is about the markers [[SMW::off]]
... [[SMW::on]]
that are used internally by the software and should be invisible to the user, although they may be exposed in the event of issues around parsing.
Contents
What are [[SMW::off]]
and [[SMW::on]]
?[edit]
They are internal markers that encapsulate a text element while per-processing templates are invoked during a result format request. [[SMW::off]]
opens the element and [[SMW::on]]
closes it.
Why are they necessary?[edit]
Nested templates and hereby nested #ask
queries can ultimately force a system to stop operating or to import unwanted annotations. To hinder parsing of such content (and annotations) retrieved from queried sources or templates, markers will signal the InTextAnnotationParser
, which is called on each Parser::parse()
event, to disregard any annotation during that process.
Recommendations[edit]
- If the
import-annotation
parameter is to true (or yes), it initiatesParser::recursivePreprocess()
without the markers and imports annotations from a 'foreign' source to the embedding page. SeeRecursiveTextProcessor::recursivePreprocess()
. ResultPrinter::maxRecursionDepth
restricts recursion of the template processing. The maximum recursion depth is configurable (2 by default).
Those parameters are provided for advanced users who understand the implication of nested templates and the possibility of circular recursion caused by templates.
References[edit]
For code, see especially :
ResultPrinter
(not to be confused with the interface of the same name)RecursiveTextProcessor
InTextAnnotationParser
InternalParseBeforeLinks::canPerformUpdate()
(method for the MW hook)