From b91b37b823b7c160f011f1d52eccd3b04cd9d294 Mon Sep 17 00:00:00 2001 From: FellippeHeitor Date: Mon, 20 Jan 2020 16:50:58 -0300 Subject: [PATCH] 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. --- source/ide/wiki/wiki_methods.bas | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/ide/wiki/wiki_methods.bas b/source/ide/wiki/wiki_methods.bas index 04b1cc9fa..b631e8669 100644 --- a/source/ide/wiki/wiki_methods.bas +++ b/source/ide/wiki/wiki_methods.bas @@ -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