on 2012 Jul 06 7:40 AM
The rules for escaping special characters in this forum are difficult impossible to fathom.
For example, the DELIMITED BY slash-x09 must be coded with two slashes in the PRE section in this question: http://sqlanywhere-forum.sap.com/questions/12518/how-do-i-refer-to-the-same-openstring-file-twice-in...
but with only one slash in the PRE section of this answer: http://sqlanywhere-forum.sap.com/questions/12518/how-do-i-refer-to-the-same-openstring-file-twice-in...
This is only one example of many... sometimes stuff doesn't need to be escaped (underscores, asterisks), sometimes it doesn't.
For example the asterisk in SELECT v_property.* needed escaping in the question linked above, but not in the answer... and right now I cannot seem to create an example of PRE where it DOES need escaping.
IMO pre-formatted text is sacrosanct... special highlighting features are acceptable ONLY IF THEY ARE PERFECTLY IMPLEMENTED... if special features have any flaws whatsoever, they should be REMOVED ALTOGETHER... code is code, not a Christmas tree.
Request clarification before answering.
I can't tell you exactly why but it's an issue with HTML parsing. The difference between the formatted text in the question and the formatted text in the answer is that there's a blank line before the <pre>
in the answer but not in the question. It's the difference between this:
Text <pre> Code </pre>
and this:
Text
<pre> Code </pre>
I suspect that in the first case, the markdown parser doesn't realize it's in a <pre>
block so you need to escape the backslash. I've seen this before when you don't leave a blank line before some 4-space-indented code, but I would have expected an explicit <pre>
to work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Graeme: Excellent! an actual answer, as opposed to a denial that the problem exists 🙂
Hmmm, I had noticed that the question and answered differed in the placement of the <pre> tag - that one had a blank line and the other did not - but when I tried to repro the issue with and without a blank line I did not get any difference. Were you actually able to confirm that that was the difference that caused the different behaviour?
As you all likely know, this forum is based on the open source software called OSQA and uses a text formatting system called Markdown. This site does document (some of) the Markdown syntax here.
I'll agree with you that the Markdown syntax can take a bit of effort to learn, but all mark-up syntaxes take effort to learn, and I have (personally) find that Markdown is easier than other ones that I have used (especially some Wiki syntaxes which IMHO are less than wonderful).
The first thing I'll mention (and this has been mentioned in other internet sites that talk about Markdown) is that there are numerous implementations of Markdown. In particular, this site uses a Javascript implementation of Markdown to generate the preview text when you are typing a question or answer. This site also uses a php (I think? ... or is it perl? Graeme can verify) implementation to generate the HTML on the backend when it renders a questions or answer for output on your browser. The issue is that these two implementations are not perfectly exactly the same and therefore you may see some differences between the preview text and the final rendered text.
I've tried to understand why you have seen the differences in the escape requirements in the two pre sections but my offline testing has not repro'ed the issue. 😞 '\\\\x09' vs '\\x09' - in fact my testing (on our development system) has shown that the question did not need to use two backslashes when you escaped the sequence. It would appear that it was just a preview vs final-rendered difference (as I mentioned above).
Edit: Note that in typing my response I had to go back and edit my response to escape the second \\x09 so that the backslash would show up. A confirmation that the rendering of escape sequences is not the same in the preview and the final answer !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Personally, I can cope with the Preview/View differences. What might be documented (somewhat) better is the use of HTML tags in Markdown - as asked in my question comment: Is using <PRE> the same as using the Markdown for code (indenting with 4 spaces...)?
In general, the missing/superfluous escapes leave something to edit now and then - not that bad, either:)
FWIW, I had to escape the < and >, too:)
User | Count |
---|---|
33 | |
21 | |
16 | |
8 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.