Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F41726670
cite-ext-add-validations.log
dominic.mayers
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
dominic.mayers
Jan 28 2024, 10:43 PM
2024-01-28 22:43:17 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
cite-ext-add-validations.log
View Options
commit 7c25ce1c1e3e7d85672e780d5284f6512279c0e1
Author: Dominic Mayers <dominic.mayers@meditationstudies.org>
Date: Sun Jan 28 16:45:15 2024 -0500
Add validations to the Cite extension
The class Validator has been redesigned. It has now five
methods, all called in Cite.php, corresponding to five
categories of errors:
1- The method validateNewRef() can be called as soon
as the attributes of the tag are processed, but only
when the tag is not in list. It is called in
gardedRef().
2- The method validateNewRefInList() can also be
called as soon as the attributes of the tag are
processed, but when the tag is in list. It is called
in gardedRef().
3- The method validateNewHalfParsedHtml() can be
called as soon as the content of the tag has been
processed. Also callled in gardedRef().
4- The method validateGroupReferences() can be called
as soon as all the ref items of a references tag has
been processed. It is called in references().
5- The method validateRemainingRef() is called at
the end after the page has been parsed. It is
called in checkRefsNoReferences(), which is called
in the onParserAfterParse() hook.
The code could be improved by having the methods
cumulate the warnings instead of returning as soon
as an error is detected. The tool used allows that.
I also changed the name of a variable in
ErrorReporter::halfParsed(), only to make the code easier
to read. The method returns half-parsed html. So, I renamed
the variable that hold the returned value (before wrapping)
from $wikitext to $halfParsed.
File Metadata
Details
Attached
Mime Type
text/plain
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14506370
Default Alt Text
cite-ext-add-validations.log (1 KB)
Attached To
Mode
T22707: Nested refs fail inside references block
Attached
Detach File
Event Timeline
Log In to Comment