Version at: 05/05/2018, 18:57 vs. version at: 08/12/2019, 16:04
11# Sandbox
22
33## Bulleted lists ##
44Nested bulleted list with two spaces for the second level of indentation and four spaces for the fourth:
55
66* a
77 * a.b
88 * a.b.c
99 * a.v
1010* z
1111
1212That list looks correct in the preview and correct in the final presentation.
1313
1414Another list where there are two spaces for each level of indentation:
1515
1616* a
1717 * a.b
1818 * a.b.c
1919 * a.v
2020* z
2121
2222Note that that list looks messed up in the preview, but correct in the final presentation.
2323
2424Here's one where there are four spaces for each level of indentation:
2525
2626* a
2727 * a.b
2828 * a.b.c
2929 * a.v
3030* z
3131
3232That list looks correct in both the preview and the final presentation.
3333
3434##Outlines
3535
3636Only two levels of indentation are shown in the "How to Format Text" box, but in reality, more are available:
3737
3838###Third level of indentation
3939####Fourth level of indentation
4040#####Fifth level of indentation
4141
4242However, the fifth level looks smaller than body text.
4343
4444###Heading that's got an apostrophe
4545
4646The link to the heading will be truncated by the apostrophe, and clicking on the link will not take you to the heading.
4747
4848###Don't assume that apostrophes are handled correctly in headings
4949
5050In this case, too, the link to the heading will be truncated by the apostrophe, and clicking on the link will not take you to the heading.
5151
5252##Code
5353
5454We need a way to present code as-is, so we want to be able to turn off wiki formatting for a block. The "code" markup (a pair of backticks) doesn't do the job.
5555
5656###Backticks
5757Code sample (note that the format differs between preview mode and final presentation):
5858
5959`
6060if (a)
6161 b
6262else
6363 c
6464`
6565
6666###Triple backticks
6767
6868This section is "fenced off" by triple backticks (see [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown)):
6969
7070```
7171if (a)
7272 b
7373else
7474 c
7575```
7676
7777but the formatting is not preserved.
7878
7979###Blockquote
8080
8181The blockquote markup doesn't do the job either, since again the format differs between preview mode and final presentation:
8282
8383>>if (a)
8484>> b
8585>>else
8686>> c
8787
8888###XML-style blockquote tag
8989Here's an attempt to use an XML-style blockquote tag:
9090
9191<blockquote>
9292if (a)
9393 b
9494else
9595 c
9696</blockquote>
9797
9898The blockquote tag disappears altogether, but does not prevent the text it surrounds from being reformatted.
9999
100100##Escaping characters
101101
102102We need ways of escaping various characters:
103103
104104###Underscore
105105Mention a name that contains a single underscore:
106106
107107a_b
108108
109109It appears correctly. But mention a name that contains an underscore twice:
110110
111111a_b a_b
112112
113113It appears as:
114114
115115ab ab
116116
117117where the first b and the second a are italicized.
118118
119119Solution: Use a backslash in front of each underscore:
120120
121121a\\\_b a\\\_b
122122
123123to produce this output:
124124
125125a\_b a\_b
126126
127127###Parenthesis
128128
129129Say that I want to write this, but in a help section, so I don't want to trigger interpretation as an actual link. Here, I've included spaces to throw off interpretation, but I want to be able to accomplish that through escape sequences instead.
130130
131131[ t e x t ] ( h t t p : / / example . com )
132132
133133Solution: put a backslash before the open-square-bracket and before the open-parenthesis and close-parenthesis. (Putting a backslash before the close-square-bracket is optional.)
134134
135135\\[text\\]\\(http://example.com\\)
136136
137137Output:
138138
139139\[text\]\(http://example.com\)
140140
141141##Bookmarklet code
142142First bookmarklet test (which succeeds in both preview and presentation modes):
143143
144144[test][1]
145145
146146
147147
148148
149149Second bookmarklet test (which succeeds only in preview mode):
150150
151151[test 2a](javascript:var%20u%20=%20%22%22;var%20e=window.prompt%28%22Enter%20URL%20or%20number%20of%22+%22%20sentence%20to%20link%20to%20this%20one%22,%22%22%29;if%28e!=null%29{var%20r=/%28http:\/\/%5B^\/%5D+\/%5Ba-z%5D{3}\/%29?%28sentences\/show\/%29?%28%5B1-9%5D%5B0-9%5D%29%28#.%29?/;var%20em=e.match%28r%29;if%28em!=null%29{var%20h=location.href;var%20hm=h.match%28r%29;u=hm%5B1%5D+%22links/add/%22+hm%5B3%5D+%22/%22+em%5B3%5D;location.href=u;}else{alert%28%22Invalid%20input.%22%29};})
152152
153153Third bookmarklet test (which succeeds only in preview mode; in presentation mode it points to http://en.wiki.tatoeba.org/articles/show/sandbox):
154154
155155[test 2][2]
156156
157157
158158javascript:var%20u%20=%20%22%22;var%20e=window.prompt%28%22Enter%20URL%20or%20number%20of%22+%22%20sentence%20to%20link%20to%20this%20one%22,%22%22%29;if%28e!=null%29{var%20r=/%28http:\/\/%5B^\/%5D+\/%5Ba-z%5D{3}\/%29?%28sentences\/show\/%29?%28%5B1-9%5D%5B0-9%5D%29%28#.%29?/;var%20em=e.match%28r%29;if%28em!=null%29{var%20h=location.href;var%20hm=h.match%28r%29;u=hm%5B1%5D+%22links/add/%22+hm%5B3%5D+%22/%22+em%5B3%5D;location.href=u;}else{alert%28%22Invalid%20input.%22%29};}
159159
160160Fourth bookmarklet test (which fails in both preview mode and presentation mode; in presentation mode it points to http://en.wiki.tatoeba.org/articles/show/sandbox):
161161
162162[test 3][3]
163163
164164
165165javascript:var%20u%20=%20"";var%20e=window.prompt("Enter%20URL%20or%20number%20of" +"%20sentence%20to%20link%20to%20this%20one","");if(e!=null){var%20r=/(http:\/\/[^\/]+\/[a-z]{3}\/)?(sentences\/show\/)?([1-9][0-9])(#.)?/;var%20em=e.match(r);if(em!=null){var%20h=location.href;var%20hm=h.match(r);u=hm1+"links/add/"+hm[3]+"/"+em[3];location.href=u;}else{alert("Invalid%20input.")};}
166166
167167Fifth bookmarklet test, in which I use backslashes to escape all backslashes, asterisks, underscores, open-square-brackets, close-square-brackets, open-parentheses, close-parentheses:
168168
169169javascript:var%20u%20=%20"";var%20e=window.prompt\("Enter%20URL%20or%20number%20of%20sentence%20to%20link%20to%20this%20one",""\);if\(e!=null\){var%20r=/\(http:\\/\\/\[^\\/\]+\\/\[a-z\]{3}\\/\)?\(sentences\\/show\\/\)?\(\[1-9\]\[0-9\]\*\)\(#.\*\)?/;var%20em=e.match\(r\);if\(em!=null\){var%20h=location.href;var%20hm=h.match\(r\);u=hm\[1\]+"links/add/"+hm\[3\]+"/"+em\[3\];location.href=u;}else{alert\("Invalid%20input."\)};}
170170
171171This works in terms of preserving the text. (Note that replacing "\\" with "\\\\" must be the first step. After that, the other replacements can be done in any order.)
172172
173173However, I'm not able to get it to work right in a link:
174174
175175[bookmarklet test](javascript:var%20u%20=%20"";var%20e=window.prompt\("Enter%20URL%20or%20number%20of%20sentence%20to%20link%20to%20this%20one",""\);if\(e!=null\){var%20r=/\(http:\\/\\/\[^\\/\]+\\/\[a-z\]{3}\\/\)?\(sentences\\/show\\/\)?\(\[1-9\]\[0-9\]\*\)\(#.\*\)?/;var%20em=e.match\(r\);if\(em!=null\){var%20h=location.href;var%20hm=h.match\(r\);u=hm\[1\]+"links/add/"+hm\[3\]+"/"+em\[3\];location.href=u;}else{alert\("Invalid%20input."\)};})
176176
177177##HTML
178178<a href="http://www.example.com">link</a>
179179
180180
181181### Code sample indicated by indentation
182182
183183Code preceded by four blank spaces per line:
184184
185185 if (a) {
186186 b;
187187 }
188188
189189Code preceded by seven blank spaces per line:
190190
191191 fn main () {
192192
193193 }
194194
195195In both cases, the code is correctly formatted during both preview and final presentation.
196196
197197 [1]: javascript:var%20p=Math.floor((Math.random()*100)+1);location.href=%22http://tatoeba.org/eng/sentences/show_all_in/epo/und/eng/indifferent/page:%22+p;
198198 [2]:
199199 [3]:
200200
201201## Images ##
202202
203203File uploaded successfully. at this address: /media/get/link_image2.png
204204
205205![Image 2](/media/get/link_image2.png)
diff view generated by jsdifflib

Version at: 05/05/2018, 18:57

# Sandbox

## Bulleted lists ##
Nested bulleted list with two spaces for the second level of indentation and four spaces for the fourth:

* a
  * a.b
      * a.b.c
  * a.v
* z  

That list looks correct in the preview and correct in the final presentation.

Another list where there are two spaces for each level of indentation:

* a
  * a.b
    * a.b.c
  * a.v
* z  

Note that that list looks messed up in the preview, but correct in the final presentation.

Here's one where there are four spaces for each level of indentation:

* a
    * a.b
        * a.b.c
    * a.v
* z  

That list looks correct in both the preview and the final presentation.

##Outlines

Only two levels of indentation are shown in the "How to Format Text" box, but in reality, more are available:

###Third level of indentation
####Fourth level of indentation
#####Fifth level of indentation

However, the fifth level looks smaller than body text.

###Heading that's got an apostrophe

The link to the heading will be truncated by the apostrophe, and clicking on the link will not take you to the heading.

###Don't assume that apostrophes are handled correctly in headings

In this case, too, the link to the heading will be truncated by the apostrophe, and clicking on the link will not take you to the heading.

##Code

We need a way to present code as-is, so we want to be able to turn off wiki formatting for a block. The "code" markup (a pair of backticks) doesn't do the job.

###Backticks
Code sample (note that the format differs between preview mode and final presentation):

`
if (a)
    b
else
    c
`

###Triple backticks

This section is "fenced off" by triple backticks (see [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown)):

```
if (a)
    b
else
    c
```

but the formatting is not preserved.

###Blockquote

The blockquote markup doesn't do the job either, since again the format differs between preview mode and final presentation:

>>if (a)
>>    b
>>else
>>    c

###XML-style blockquote tag
Here's an attempt to use an XML-style blockquote tag:

<blockquote>
if (a)
    b
else
    c
</blockquote>

The blockquote tag disappears altogether, but does not prevent the text it surrounds from being reformatted.

##Escaping characters

We need ways of escaping various characters:

###Underscore
Mention a name that contains a single underscore:

a_b

It appears correctly. But mention a name that contains an underscore twice:

a_b   a_b

It appears as:

ab ab 

where the first b and the second a are italicized. 

Solution: Use a backslash in front of each underscore:

a\\\_b a\\\_b

to produce this output:

a\_b a\_b

###Parenthesis

Say that I want to write this, but in a help section, so I don't want to trigger interpretation as an actual link. Here, I've included spaces to throw off interpretation, but I want to be able to accomplish that through escape sequences instead.

[ t e x t ] ( h t t p : / / example . com )

Solution: put a backslash before the open-square-bracket and before the open-parenthesis and close-parenthesis. (Putting a backslash before the close-square-bracket is optional.)

\\[text\\]\\(http://example.com\\)

Output:

\[text\]\(http://example.com\)

##Bookmarklet code
First bookmarklet test (which succeeds in both preview and presentation modes):

[test][1]




Second bookmarklet test (which succeeds only in preview mode):

[test 2a](javascript:var%20u%20=%20%22%22;var%20e=window.prompt%28%22Enter%20URL%20or%20number%20of%22+%22%20sentence%20to%20link%20to%20this%20one%22,%22%22%29;if%28e!=null%29{var%20r=/%28http:\/\/%5B^\/%5D+\/%5Ba-z%5D{3}\/%29?%28sentences\/show\/%29?%28%5B1-9%5D%5B0-9%5D%29%28#.%29?/;var%20em=e.match%28r%29;if%28em!=null%29{var%20h=location.href;var%20hm=h.match%28r%29;u=hm%5B1%5D+%22links/add/%22+hm%5B3%5D+%22/%22+em%5B3%5D;location.href=u;}else{alert%28%22Invalid%20input.%22%29};})

Third bookmarklet test (which succeeds only in preview mode; in presentation mode it points to http://en.wiki.tatoeba.org/articles/show/sandbox):
 
[test 2][2]


javascript:var%20u%20=%20%22%22;var%20e=window.prompt%28%22Enter%20URL%20or%20number%20of%22+%22%20sentence%20to%20link%20to%20this%20one%22,%22%22%29;if%28e!=null%29{var%20r=/%28http:\/\/%5B^\/%5D+\/%5Ba-z%5D{3}\/%29?%28sentences\/show\/%29?%28%5B1-9%5D%5B0-9%5D%29%28#.%29?/;var%20em=e.match%28r%29;if%28em!=null%29{var%20h=location.href;var%20hm=h.match%28r%29;u=hm%5B1%5D+%22links/add/%22+hm%5B3%5D+%22/%22+em%5B3%5D;location.href=u;}else{alert%28%22Invalid%20input.%22%29};}

Fourth bookmarklet test (which fails in both preview mode and presentation mode; in presentation mode it points to http://en.wiki.tatoeba.org/articles/show/sandbox):

[test 3][3]


javascript:var%20u%20=%20"";var%20e=window.prompt("Enter%20URL%20or%20number%20of" +"%20sentence%20to%20link%20to%20this%20one","");if(e!=null){var%20r=/(http:\/\/[^\/]+\/[a-z]{3}\/)?(sentences\/show\/)?([1-9][0-9])(#.)?/;var%20em=e.match(r);if(em!=null){var%20h=location.href;var%20hm=h.match(r);u=hm1+"links/add/"+hm[3]+"/"+em[3];location.href=u;}else{alert("Invalid%20input.")};}

Fifth bookmarklet test, in which I use backslashes to escape all backslashes, asterisks, underscores, open-square-brackets, close-square-brackets, open-parentheses, close-parentheses:

javascript:var%20u%20=%20"";var%20e=window.prompt\("Enter%20URL%20or%20number%20of%20sentence%20to%20link%20to%20this%20one",""\);if\(e!=null\){var%20r=/\(http:\\/\\/\[^\\/\]+\\/\[a-z\]{3}\\/\)?\(sentences\\/show\\/\)?\(\[1-9\]\[0-9\]\*\)\(#.\*\)?/;var%20em=e.match\(r\);if\(em!=null\){var%20h=location.href;var%20hm=h.match\(r\);u=hm\[1\]+"links/add/"+hm\[3\]+"/"+em\[3\];location.href=u;}else{alert\("Invalid%20input."\)};}

This works in terms of preserving the text. (Note that replacing "\\" with "\\\\" must be the first step. After that, the other replacements can be done in any order.)

However, I'm not able to get it to work right in a link:

[bookmarklet test](javascript:var%20u%20=%20"";var%20e=window.prompt\("Enter%20URL%20or%20number%20of%20sentence%20to%20link%20to%20this%20one",""\);if\(e!=null\){var%20r=/\(http:\\/\\/\[^\\/\]+\\/\[a-z\]{3}\\/\)?\(sentences\\/show\\/\)?\(\[1-9\]\[0-9\]\*\)\(#.\*\)?/;var%20em=e.match\(r\);if\(em!=null\){var%20h=location.href;var%20hm=h.match\(r\);u=hm\[1\]+"links/add/"+hm\[3\]+"/"+em\[3\];location.href=u;}else{alert\("Invalid%20input."\)};})

##HTML
<a href="http://www.example.com">link</a>


### Code sample indicated by indentation

Code preceded by four blank spaces per line:

    if (a) {
        b;
    }

Code preceded by seven blank spaces per line:
    
       fn main () {
    
       }

In both cases, the code is correctly formatted during both preview and final presentation.

  [1]: javascript:var%20p=Math.floor((Math.random()*100)+1);location.href=%22http://tatoeba.org/eng/sentences/show_all_in/epo/und/eng/indifferent/page:%22+p;
  [2]: 
  [3]: 

## Images ##

File uploaded successfully. at this address: /media/get/link_image2.png 

![Image 2](/media/get/link_image2.png)

version at: 08/12/2019, 16:04

# Sandbox

## Bulleted lists ##
Nested bulleted list with two spaces for the second level of indentation and four spaces for the fourth:

* a
  * a.b
      * a.b.c
  * a.v
* z  

That list looks correct in the preview and correct in the final presentation.

Another list where there are two spaces for each level of indentation:

* a
  * a.b
    * a.b.c
  * a.v
* z  

Note that that list looks messed up in the preview, but correct in the final presentation.

Here's one where there are four spaces for each level of indentation:

* a
    * a.b
        * a.b.c
    * a.v
* z  

That list looks correct in both the preview and the final presentation.

##Outlines

Only two levels of indentation are shown in the "How to Format Text" box, but in reality, more are available:

###Third level of indentation
####Fourth level of indentation
#####Fifth level of indentation

However, the fifth level looks smaller than body text.

###Heading that's got an apostrophe

The link to the heading will be truncated by the apostrophe, and clicking on the link will not take you to the heading.

###Don't assume that apostrophes are handled correctly in headings

In this case, too, the link to the heading will be truncated by the apostrophe, and clicking on the link will not take you to the heading.

##Code

We need a way to present code as-is, so we want to be able to turn off wiki formatting for a block. The "code" markup (a pair of backticks) doesn't do the job.

###Backticks
Code sample (note that the format differs between preview mode and final presentation):

`
if (a)
    b
else
    c
`

###Triple backticks

This section is "fenced off" by triple backticks (see [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown)):

```
if (a)
    b
else
    c
```

but the formatting is not preserved.

###Blockquote

The blockquote markup doesn't do the job either, since again the format differs between preview mode and final presentation:

>>if (a)
>>    b
>>else
>>    c

###XML-style blockquote tag
Here's an attempt to use an XML-style blockquote tag:

<blockquote>
if (a)
    b
else
    c
</blockquote>

The blockquote tag disappears altogether, but does not prevent the text it surrounds from being reformatted.

##Escaping characters

We need ways of escaping various characters:

###Underscore
Mention a name that contains a single underscore:

a_b

It appears correctly. But mention a name that contains an underscore twice:

a_b   a_b

It appears as:

ab ab 

where the first b and the second a are italicized. 

Solution: Use a backslash in front of each underscore:

a\\\_b a\\\_b

to produce this output:

a\_b a\_b

###Parenthesis

Say that I want to write this, but in a help section, so I don't want to trigger interpretation as an actual link. Here, I've included spaces to throw off interpretation, but I want to be able to accomplish that through escape sequences instead.

[ t e x t ] ( h t t p : / / example . com )

Solution: put a backslash before the open-square-bracket and before the open-parenthesis and close-parenthesis. (Putting a backslash before the close-square-bracket is optional.)

\\[text\\]\\(http://example.com\\)

Output:

\[text\]\(http://example.com\)

##Bookmarklet code
First bookmarklet test (which succeeds in both preview and presentation modes):

[test][1]




Second bookmarklet test (which succeeds only in preview mode):

[test 2a](javascript:var%20u%20=%20%22%22;var%20e=window.prompt%28%22Enter%20URL%20or%20number%20of%22+%22%20sentence%20to%20link%20to%20this%20one%22,%22%22%29;if%28e!=null%29{var%20r=/%28http:\/\/%5B^\/%5D+\/%5Ba-z%5D{3}\/%29?%28sentences\/show\/%29?%28%5B1-9%5D%5B0-9%5D%29%28#.%29?/;var%20em=e.match%28r%29;if%28em!=null%29{var%20h=location.href;var%20hm=h.match%28r%29;u=hm%5B1%5D+%22links/add/%22+hm%5B3%5D+%22/%22+em%5B3%5D;location.href=u;}else{alert%28%22Invalid%20input.%22%29};})

Third bookmarklet test (which succeeds only in preview mode; in presentation mode it points to http://en.wiki.tatoeba.org/articles/show/sandbox):
 
[test 2][2]


javascript:var%20u%20=%20%22%22;var%20e=window.prompt%28%22Enter%20URL%20or%20number%20of%22+%22%20sentence%20to%20link%20to%20this%20one%22,%22%22%29;if%28e!=null%29{var%20r=/%28http:\/\/%5B^\/%5D+\/%5Ba-z%5D{3}\/%29?%28sentences\/show\/%29?%28%5B1-9%5D%5B0-9%5D%29%28#.%29?/;var%20em=e.match%28r%29;if%28em!=null%29{var%20h=location.href;var%20hm=h.match%28r%29;u=hm%5B1%5D+%22links/add/%22+hm%5B3%5D+%22/%22+em%5B3%5D;location.href=u;}else{alert%28%22Invalid%20input.%22%29};}

Fourth bookmarklet test (which fails in both preview mode and presentation mode; in presentation mode it points to http://en.wiki.tatoeba.org/articles/show/sandbox):

[test 3][3]


javascript:var%20u%20=%20"";var%20e=window.prompt("Enter%20URL%20or%20number%20of" +"%20sentence%20to%20link%20to%20this%20one","");if(e!=null){var%20r=/(http:\/\/[^\/]+\/[a-z]{3}\/)?(sentences\/show\/)?([1-9][0-9])(#.)?/;var%20em=e.match(r);if(em!=null){var%20h=location.href;var%20hm=h.match(r);u=hm1+"links/add/"+hm[3]+"/"+em[3];location.href=u;}else{alert("Invalid%20input.")};}

Fifth bookmarklet test, in which I use backslashes to escape all backslashes, asterisks, underscores, open-square-brackets, close-square-brackets, open-parentheses, close-parentheses:

javascript:var%20u%20=%20"";var%20e=window.prompt\("Enter%20URL%20or%20number%20of%20sentence%20to%20link%20to%20this%20one",""\);if\(e!=null\){var%20r=/\(http:\\/\\/\[^\\/\]+\\/\[a-z\]{3}\\/\)?\(sentences\\/show\\/\)?\(\[1-9\]\[0-9\]\*\)\(#.\*\)?/;var%20em=e.match\(r\);if\(em!=null\){var%20h=location.href;var%20hm=h.match\(r\);u=hm\[1\]+"links/add/"+hm\[3\]+"/"+em\[3\];location.href=u;}else{alert\("Invalid%20input."\)};}

This works in terms of preserving the text. (Note that replacing "\\" with "\\\\" must be the first step. After that, the other replacements can be done in any order.)

However, I'm not able to get it to work right in a link:

[bookmarklet test](javascript:var%20u%20=%20"";var%20e=window.prompt\("Enter%20URL%20or%20number%20of%20sentence%20to%20link%20to%20this%20one",""\);if\(e!=null\){var%20r=/\(http:\\/\\/\[^\\/\]+\\/\[a-z\]{3}\\/\)?\(sentences\\/show\\/\)?\(\[1-9\]\[0-9\]\*\)\(#.\*\)?/;var%20em=e.match\(r\);if\(em!=null\){var%20h=location.href;var%20hm=h.match\(r\);u=hm\[1\]+"links/add/"+hm\[3\]+"/"+em\[3\];location.href=u;}else{alert\("Invalid%20input."\)};})

##HTML
<a href="http://www.example.com">link</a>


### Code sample indicated by indentation

Code preceded by four blank spaces per line:

    if (a) {
        b;
    }

Code preceded by seven blank spaces per line:
    
       fn main () {
    
       }

In both cases, the code is correctly formatted during both preview and final presentation.

  [1]: javascript:var%20p=Math.floor((Math.random()*100)+1);location.href=%22http://tatoeba.org/eng/sentences/show_all_in/epo/und/eng/indifferent/page:%22+p;
  [2]: 
  [3]: 

## Images ##

File uploaded successfully. at this address: /media/get/link_image2.png 

![Image 2](/media/get/link_image2.png)

Note

The lines in green are the lines that have been added in the new version. The lines in red are those that have been removed.