1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-01 12:40:36 +00:00

Properly render help files in Windows

Both files checked out from the repository and packed in the 7z we provide had CRLF for line endings in the help files. This change makes it so the extra CR is removed from the offline help as the user fetches them locally.
This commit is contained in:
FellippeHeitor 2020-01-20 16:50:58 -03:00
parent 0f91d0f8d3
commit b91b37b823

View file

@ -30,6 +30,20 @@ FUNCTION Wiki$ (PageName$)
a$ = SPACE$(LOF(fh))
GET #fh, , a$
CLOSE #fh
chr13 = INSTR(a$, CHR$(13))
removedchr13 = 0
DO WHILE chr13 > 0
removedchr13 = -1
a$ = LEFT$(a$, chr13 - 1) + MID$(a$, chr13 + 1)
chr13 = INSTR(a$, CHR$(13))
LOOP
IF removedchr13 THEN
fh = FREEFILE
OPEN Cache_Folder$ + "/" + PageName2$ + ".txt" FOR OUTPUT AS #fh: CLOSE #fh
OPEN Cache_Folder$ + "/" + PageName2$ + ".txt" FOR BINARY AS #fh
PUT #fh, 1, a$
CLOSE #fh
END IF
Wiki$ = a$
EXIT FUNCTION
END IF