Menu

#184 what to do with tags inside tags

workingwiki
open
None
5
2013-05-07
2012-06-12
Lee Worden
No

When a source-file or project-file (or project-description) tag is within the content of another tag, I think it should be ignored. There may be exceptions however, like <code> and maybe others that just affect formatting and don't actually go to a tag hook that will call recursiveTagParse() as desired. Currently I have a blacklist of tags to be ignored, and go ahead and accept source-file definitions everywhere else. This can lead to buggy behavior, for instance when a source file is inside a tag that's defined by another extension. It should be made more robust.

Related

Bugs: #419

Discussion

  • Lee Worden

    Lee Worden - 2012-06-12

    One thing would be to switch to a whitelist of tags like <code> and skip all things not on the list. One issue here would be needing to keep it updated if MediaWiki should ever add a new tag to the core parser, or change them.

    It would be more elegant to somehow avoid parsing the page myself and leave it entirely to the MW parser. How would I collect the source file contents from pages other than the one we're rendering? Store them from the last time it was parsed? That would be reliably up to date, but I'd have to make a db table (or a special directory) to keep them all in, when they're already in the db. Or just sync them into the working directory when their page is saved? That would leave us stranded when the directory gets cleared. Or get them by parsing all the pages? Too slow. Maybe I could make a db table recording their LOCATIONS in their pages, for fast retrieval without reparsing.

    (But maybe a whitelist of tags would be fine)

     

    Last edit: Lee Worden 2013-02-20
  • Lee Worden

    Lee Worden - 2013-02-20
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1 +1 @@
    -When a source-file or project-file (or project-description) tag is within the content of another tag, I think it should be ignored.  There may be exceptions however, like <code> and maybe others that just affect formatting and don't actually go to a tag hook that will call recursiveTagParse() as desired.  Currently I have a blacklist of tags to be ignored, and go ahead and accept source-file definitions everywhere else.  This can lead to buggy behavior, for instance when a source file is inside a tag that's defined by another extension.  It should be made more robust.
    +When a source-file or project-file (or project-description) tag is within the content of another tag, I think it should be ignored.  There may be exceptions however, like &lt;code> and maybe others that just affect formatting and don't actually go to a tag hook that will call recursiveTagParse() as desired.  Currently I have a blacklist of tags to be ignored, and go ahead and accept source-file definitions everywhere else.  This can lead to buggy behavior, for instance when a source file is inside a tag that's defined by another extension.  It should be made more robust.
    
     

Anonymous
Anonymous

Add attachments
Cancel