Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grammar errors caused by templating system removing whitespace #64

Open
roryokane opened this issue Apr 28, 2020 · 1 comment
Open

Grammar errors caused by templating system removing whitespace #64

roryokane opened this issue Apr 28, 2020 · 1 comment

Comments

@roryokane
Copy link

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.

@ncannasse
Copy link
Member

@markknol any idea ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants