Last modified: 2014-07-25 16:00:49 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68982, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66982 - WTS code improvement: Consider moving all nowiki-indent-pre supression code to post-processing pass
WTS code improvement: Consider moving all nowiki-indent-pre supression code t...
Status: NEW
Product: Parsoid
Classification: Unclassified
serializer (Other open bugs)
unspecified
All All
: Normal enhancement
: ---
Assigned To: Parsoid Team
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-23 16:05 UTC by ssastry
Modified: 2014-07-25 16:00 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description ssastry 2014-06-23 16:05:30 UTC
This bug is courtesy IRC discussion with gwicke about possible code cleanup/refactoring.

Over time, indent-pre nowiki removal code has ended up in 3 different areas:

1. wts escapeWikitext code that checks for leading space in sol context -- this code might be redundant now given that all whitespace before text nodes is now made part of separator text and handled there. To be investigated.

2. separator makeSepIndentPreSafe code that does dom analysis to examine surrounding context of the whitespace to see if the whitespace will lead to an indent-pre or not.

3. Postprocessing nowiki removal pass that eliminates spurious nowikis added on lines that have block nodes (but this pass can be made more generic).

Solution 2. will continue to have to exist for multi-line scenarios (ex: "<blockquote>\n   a\n</blockquote>" which won't be handled by 3. Currently solution 2. also handles cases with " <figure>...</figure>" which serializes to " [[Image:..]]" Since solution 3. only operates on final serialized wikitext, any figure and other indent-pre suppressing tags will have been lost. So, one option is to consider adding markers for figures and others that might suppress nowikis and then strip them in phase 3.

Not sure if this last piece of cleanup is necessarily any better or simpler, but it will at least centralize more of the nowiki-suppression/removal code in the last phase (as long as perf is unaffected and the same amount of work is not involved in adding the markers).

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links