Uploaded image for project: 'XWiki Rendering'
  1. XWiki Rendering
  2. XRENDERING-636

Previous event information in BlockStateChainingListener is inconsistent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 14.0-rc-1
    • 3.0 M3
    • API
    • None
    • Unit
    • Unknown
    • N/A
    • N/A
    • Pull Request accepted

    Description

      The information about the previous event can be called inconsistent at best. I found the following issues:

      • Many "on"-Events set the previous event before calling the next listener in the chain, meaning that in an event handler, the renderer will always get its own event instead of the previous event.
      • onVerbatim always sets the VERBATIM_STANDALONE event even when inline is true - and not the VERBATIM_INLINE-event (though I'm wondering why there are two versions of this event and not of any other event).
      • endMetaData and endGroup are not implemented, meaning that the previous event will never be a metadata or group event.

      There are also no unit tests that could have identified these issues. In xwiki-rendering, getPreviousEvent() is only used for quotations, so both the impact of this bug as well as the breaking changes introduced by the fix should be small.

      Attachments

        Activity

          People

            MichaelHamann Michael Hamann
            MichaelHamann Michael Hamann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: