Fixed MakeDocs created wrong NewLine statements in compiled docs


CX Code Contributor
3rd Party Module Dev
Tutorial Author
3rd Party Target Dev
3rd Party Tool Dev
Jun 19, 2017
Somehow, with the last update, Makedocs faults at creating new lines when compiling docs.


I have to look into this.

The fix is online. See this post:
Last edited:
Is this after modifying the help files or just a general rebuild?
I've just cloned the current develop and rebuilt for Windows and all seems Ok.
This is with the latest release. Have to look into it when i am back home.
Ok, that BUG is in for a while. Somehow the line ending was changed (Linux anyone ? :) ). When I just savea file on my windows system and rebuild it, then the docs are build fine on in thatpart. As we are talking of quite a bit of files, I think MakeDocs need to take care of this automatically.
Could be a git CRLF/LF thing or the type of editor used to make changes. There should be a few tools to change them back on the web. Dos2Unix and Unix2Dos should do it.

Edit: May be a standard recommended editor should be mentioned in the docs to use for changes.
I always use ted for it.
I think the best way would be for MakeDocs to force LF line endings via simple replace all CRLF to LF and just use LF to separate lines instead of the OS default. This way, if the file had LF endings to begin with, nothing will be changed and will be processed fine. If it had CRLF, all CR's will be removed and docs will be processed fine.

Why replace CRLF to LF and not the vice versa? Simple, if the document had CRLF already, replacing LF with CRLF would create a nast CRCRLF eldritch abomination ;). And we don't want to mess with the Great Old Ones.
Still, I think making MakeDocs replace all CRLF endings with LF endings prior to actual processing of the file would be better as developers won't need to care about endings or Github/Git bugs. Why make humans who make mistakes do an extra step (checking for consistent line endings), when you can automate it away?
Check out the cross platform Visual Studio Code. It will tell you what the line endings and encoding are in a file.
Yup, the ones that show the problem have a CRLF line ending. It needs to be LF to be used without a problem through MakeDocs. So far I can't find the damn code part were I could fix it during the file reading inside MakeDocs. :confused: But I will keep on pluckin'. One day I will succeed. :rolleyes:
Yup, the ones that show the problem have a CRLF line ending.
If it's just a few use Visual Studio code to change the line ending back to CRLF
Look in toker.cxs the Bump method and look for chr=10. You could use a method as part of the condition statement to check for CR(13)LF(10) first to just return the code LF(10).

Edit: This bit of code should be the one
If chr=10
        Else If str="'"
            While Chr() And Chr()<>10
            If Chr()=10 _pos+=1
Edit: This bit of code should be the one
I swear/think I tried that. But will do so again.
If it's just a few use Visual Studio code to change the line ending back to CRLF
Sure could do that. But it is better that MakeDocs takes care of that. As we have several people that contribute. And god knows what editor they use and from which platform. And also you have to think about third part docs. The same problem can happen there too.
Which operating system is showing problems with line endings?
I am on windows and the files are the ones from the itchio distribution.

Does it generate the html files faulty on Linux?
Last edited:
Yes seeing this on all three platforms.
Ok, even with @dawlanes suggestion, that didn't work. So I went and modified the .gitattributes file on the repository. Checkout everything and now was able to create correct doc files.

Attached is a fixed version. Please replace the content of your docs folder with the stuff inside the zip file.

The online docs are fixed too.


    594.4 KB · Views: 349
@Martin, when you create a new distribution, make sure you make a full checkout from the repository. This way the file endings are changed.
I would add a few other bits in the .gitattributes as well.

# Visual Studio/Windows lf => crlf
*.bat text eol=crlf
*.sln text eof=crlf
*.vcxproj text eof=crlf
*.filters text eof=crlf
*.txt text eof=crlf
*.csproj text eol=crlf
*.ps1 text eol=crlf

# Image files
*.bmp binary
*.png binary
*.jpg binary
*.jpeg binary
*.ico binary
*.icns binary

# Other binrary types
*.pdf binary
*.a binary
*.lib binary

# Compression
*.gz binary
*.zip binary
*.jar binary

And may be
.gitattributes text eol=lf
.gitignore text eol=lf
.gitconfig text eol=lf
Top Bottom