I'm writing a VBSscript for uploading plain "raw" text into my Mediawiki, but I fail to add newlines to the raw text.
For example when I try concatenating new lines in the strings with VBS code, like so:
S = S & "Some string" & Chr(10) & "some other string"
... and upload it (via api EditPage), and then look at the raw text with a browser on the Wiki (in edit mode), then the text looks like so:
"Some string%Asome other string"
Tha is, no real line break, only the "%A" representation.
I also tried reading the text file (from disk) line for line like so, but no line breaks are inserted here either :
Function ReadEntireFile(aFile)
Const ForReading = 1
Dim S
Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
Dim theFile: Set theFile = fso.OpenTextFile(aFile, ForReading, False)
S = ""
Do While theFile.AtEndOfStream <> True
S = S & Chr(13) & Chr(10) & theFile.ReadLine
Loop
theFile.Close
ReadEntireFile = S
End Function
... but I get the same kind of result, that is:
"First string part%D%Asecond string part"
As you know, if you edit the mediawiki article directly, then there's no problem entering new lines (just press "ENTER" as usual), but why do I fail to insert #13 (cr) and #10 (lf) into text uploaded via the api? I must be overlooking something.
Notice that I'm fully aware of syntaxes for Html parsing of line breaks (<br />
etc) but that's not what I'm at here, I want to insert "raw" line breaks in the "raw" source text of the Mediawiki articles.
Q: So, is there any trick for inserting newlines which I have overlooked when using mediwiki api, or is it simply not possible?