Extra spaces added before ATX headings that follows a list

Issue #708 resolved
Kuro Kurosaka created an issue

This is a special case of issue #687 that has been separated out as it is more critical to fix. Using space1.md file, if we run tikal of the recent M35-snapshot build to extract then merge to reproduce the original file, as shown below, the reproduced file (out.md) has differences.

There are two extra blank lines and there are four spaces before the ATX heading marker ###.

The extra blank lines issue was there with the previous releases M35, and probably earlier releases. These extra lines are ignored by Markdown rendering engine. This is kept being tracked by the issue #687.

The extra spaces before the ATX heading marker changes the semantic of the Markdown file and it affects everybody. This issue did not exist with M35. It is believed to be introduced by recent (Q1 2018) changes. This needs to be addressed quickly. This ticket tracks the fixing of these extra spaces inserted before the ATX headings only.

$ ./tikal.sh -x space1.md
$ ./tikal.sh -m space1.md.xlf 
$ diff space1.md space1.out.md
1,8c1,10
< *   **PointCloudType** - type of point cloud loaded into a Revit document. Each PointCloudType maps to a single file or identifier (depending upon the type of Point Cloud Engine which governs it).
< *   **PointCloudInstance** - an instance of a point cloud in a location in the Revit project.
< *   **PointCloudFilter** - a filter determining the volume of interest when extracting points.
< *   **PointCollection** - a collection of points obtained from an instance and a filter.
< *   **PointIterator** - an iterator for the points in a PointCollection.
< *   **CloudPoint** - an individual point cloud point, representing an X, Y, Z location in the coordinates of the cloud, and a color.
< *   **PointCloudOverrides** - and its related settings classes specify graphic overrides that are stored by a view to be applied to a PointCloudInstance element, or a scan within the element.
< ### Point cloud file paths
---
> * **PointCloudType** - type of point cloud loaded into a Revit document. Each PointCloudType maps to a single file or identifier (depending upon the type of Point Cloud Engine which governs it).
> * **PointCloudInstance** - an instance of a point cloud in a location in the Revit project.
> * **PointCloudFilter** - a filter determining the volume of interest when extracting points.
> * **PointCollection** - a collection of points obtained from an instance and a filter.
> * **PointIterator** - an iterator for the points in a PointCollection.
> * **CloudPoint** - an individual point cloud point, representing an X, Y, Z location in the coordinates of the cloud, and a color.
> * **PointCloudOverrides** - and its related settings classes specify graphic overrides that are stored by a view to be applied to a PointCloudInstance element, or a scan within the element.
> 
>    ### Point cloud file paths
> 

Comments (2)

  1. Kuro Kurosaka reporter

    This was due to the use of the GitHub emulation profile in MarkdownParser:

        private static final MutableDataHolder OPTIONS = new MutableDataSet()
                .set(Parser.PARSER_EMULATION_PROFILE, ParserEmulationProfile.GITHUB_DOC)
                .set(// other settings follow ....
    

    It turned out this profile is to support the old GitHub markdown engine. GitHub is now based on the CommonMark, which is the default setting of Flexmark-java. So this profile setting is not needed.

    By just removing this set method call was all what is needed to fix this issue.

  2. Log in to comment