HomePhabricator

Fix error in Parser.js while parsing small sections

Description

Fix error in Parser.js while parsing small sections

The transclusionContext capturing logic does not need to bother
about currentBlock while working on single sections(such as MT)

In MTClient there is an attempt to build the sourceDoc with the
given HTML. If that HTML does not have a common ancestor(wrapper
tag), parsing will be re-attempted with a wrapper tag. But
the parsing without wrapper was failing since the assumption
about the currentBlock is not met and js error is thrown.

To avoid js error about accessing the attributes, added a check.
Also added tests. The test7-result.* files are empty because
parsing without wrapper tags will not have any results as expected.

Bug: T198830
Change-Id: I224b1f31b4420e60bee78cb227c3acb0a235b507

Details

Provenance
santhoshAuthored on Jul 5 2018, 9:43 AM
Parents
rGCXS77154ffed9a2: Merge "Matxin: Improve error handling code"
Branches
Unknown
Tags
Unknown
ChangeId
I224b1f31b4420e60bee78cb227c3acb0a235b507