HeapsIO / heaps.io

Website sources

Home Page:https://heaps.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grammar errors caused by templating system removing whitespace

roryokane opened this issue · comments

Problem

When visiting https://heaps.io/ for the first time, one of the first things I noticed was a grammar error (bolded below) in the lead paragraph:

Heaps.io is a mature cross platform graphics engine designed for high performance games.It is designed […]

The period should have a space after it.

The next page I went to was About, which had the same grammar error in its lead paragraph:

Heaps.io delivers fast iterations, real development power and multi-platform compilation with native access and minimal overhead.The toolkit is flexible, open-source and free.

These prominent errors made the website look neglected, which made me worry about the quality of Heaps itself. So I think they are important to fix.

After I did a project-wide search, I found one more instance of this error, on the home page:

Heaps.io is free and open source, with a large and supportive community pushing its growth and evolution.Feel free to contribute […]

Cause of the problem

Looking in the source code of the website, these grammar errors don’t look like grammar errors in the source files, assets/content/index.mtt and assets/content/about.mtt. For example, here’s the source of the lead paragraph on the home page:

		<p class="lead">
			Heaps.io is a mature cross platform graphics engine designed for high performance games.
			It is designed to leverage modern GPUs that are commonly available on both desktop and mobile devices.
		</p>

These sentences are written on separate lines. If this were normal HTML, the browser would automatically turn the newline and tab characters between the sentences into a single space, avoiding the grammatical error. So the problem is that your mtt templating system is removing all the whitespace between paragraphs, and that your .mtt files were not written with that knowledge in mind.

Locating the affected paragraphs

I found the three instances of this problem I quoted above in the .mtt files in the repo by searching all files for the following regex:

\.\n\t*[A-Z]

Idea for a fix

I don’t know if removing all whitespace is expected behavior in mtt files. Some searching suggested that .mtt files are processed by the templo library, but that library’s README doesn’t mention anything about its whitespace handling or how to manually add whitespace.

If removing whitespace is expected behavior for Templo and not a bug, and if Templo doesn’t have special markup that affects whitespace handling, a possible solution would be to add trailing spaces to the end of certain paragraphs.