Last modified: 2014-07-25 16:00:49 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).