Parser: Add guessSectionNameFromStrippedText() and refactor
authorRoan Kattouw <roan.kattouw@gmail.com>
Wed, 22 Nov 2017 23:06:21 +0000 (18:06 -0500)
committerRoan Kattouw <roan.kattouw@gmail.com>
Thu, 7 Dec 2017 18:22:45 +0000 (10:22 -0800)
commit6f07389ef2eba048c17c7e343fb8fbb026a4dbd6
tree817ed1f5cb4ce3e87b281ba46e7aad645f26f5ad
parent4dbb6b2d778ec98bcf7b8de8f908ac5db8459c49
Parser: Add guessSectionNameFromStrippedText() and refactor

Split up guessSectionNameFromWikiText() into pieces to reduce code
duplication, and provide guessSectionNameFromStrippedText() which
doesn't do link stripping.

Really these should be named guessSection*ANCHOR*From... because they
return an anchor (with encoding and a '#' prefix) instead of a section
name, but I didn't want to rename the existing one.

Also make normalizeSectionName static (it doesn't use $this) so that
guessSectionNameFromStrippedText() can be static as well.

Change-Id: I56b9dda805a51517549c5ed709f4bd747ca04577
includes/parser/Parser.php