Version at: 05/05/2018, 18:57 vs. version at: 05/05/2018, 18:57
11# Sandbox
2
3Use this page to experiment with wiki markup.
4* [New page](my-new-page)
52
63## Bulleted lists ##
74Nested bulleted list with two spaces for the second level of indentation and four spaces for the fourth:
85
96* a
107 * a.b
118 * a.b.c
129 * a.v
1310* z
1411
1512That list looks correct in the preview and correct in the final presentation.
1613
1714Another list where there are two spaces for each level of indentation:
1815
1916* a
2017 * a.b
2118 * a.b.c
2219 * a.v
2320* z
2421
2522Note that that list looks messed up in the preview, but correct in the final presentation.
2623
2724Here's one where there are four spaces for each level of indentation:
2825
2926* a
3027 * a.b
3128 * a.b.c
3229 * a.v
3330* z
3431
3532That list looks correct in both the preview and the final presentation.
3633
3734##Outlines
3835
3936Only two levels of indentation are shown in the "How to Format Text" box, but in reality, more are available:
4037
4138###Third level of indentation
4239####Fourth level of indentation
4340#####Fifth level of indentation
4441
4542However, the fifth level looks smaller than body text.
4643
4744###Heading that's got an apostrophe
4845
4946The link to the heading will be truncated by the apostrophe, and clicking on the link will not take you to the heading.
5047
5148###Don't assume that apostrophes are handled correctly in headings
5249
5350In 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.
5451
5552##Code
5653
5754We 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.
5855
5956###Backticks
6057Code sample (note that the format differs between preview mode and final presentation):
6158
6259`
6360if (a)
6461 b
6562else
6663 c
6764`
6865
6966###Triple backticks
7067
7168This section is "fenced off" by triple backticks (see [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown)):
7269
7370```
7471if (a)
7572 b
7673else
7774 c
7875```
7976
8077but the formatting is not preserved.
8178
8279###Blockquote
8380
8481The blockquote markup doesn't do the job either, since again the format differs between preview mode and final presentation:
8582
8683>>if (a)
8784>> b
8885>>else
8986>> c
9087
9188###XML-style blockquote tag
9289Here's an attempt to use an XML-style blockquote tag:
9390
9491<blockquote>
9592if (a)
9693 b
9794else
9895 c
9996</blockquote>
10097
10198The blockquote tag disappears altogether, but does not prevent the text it surrounds from being reformatted.
10299
103100##Escaping characters
104101
105102We need ways of escaping various characters:
106103
107104###Underscore
108105Mention a name that contains a single underscore:
109106
110107a_b
111108
112109It appears correctly. But mention a name that contains an underscore twice:
113110
114111a_b a_b
115112
116113It appears as:
117114
118115ab ab
119116
120117where the first b and the second a are italicized.
121118
122119Solution: Use a backslash in front of each underscore:
123120
124121a\\\_b a\\\_b
125122
126123to produce this output:
127124
128125a\_b a\_b
129126
130127###Parenthesis
131128
132129Say 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.
133130
134131[ t e x t ] ( h t t p : / / example . com )
135132
136133Solution: 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.)
137134
138135\\[text\\]\\(http://example.com\\)
139136
140137Output:
141138
142139\[text\]\(http://example.com\)
143140
144141##Bookmarklet code
145142First bookmarklet test (which succeeds in both preview and presentation modes):
146143
147144[test][1]
148145
149146
150147
151148
152149Second bookmarklet test (which succeeds only in preview mode):
153150
154151[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};})
155152
156153Third bookmarklet test (which succeeds only in preview mode; in presentation mode it points to http://en.wiki.tatoeba.org/articles/show/sandbox):
157154
158155[test 2][2]
159156
160157
161158javascript: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};}
162159
163160Fourth 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):
164161
165162[test 3][3]
166163
167164
168165javascript: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.")};}
169166
170167Fifth bookmarklet test, in which I use backslashes to escape all backslashes, asterisks, underscores, open-square-brackets, close-square-brackets, open-parentheses, close-parentheses:
171168
172169javascript: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."\)};}
173170
174171This 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.)
175172
176173However, I'm not able to get it to work right in a link:
177174
178175[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."\)};})
179176
180177##HTML
181178<a href="http://www.example.com">link</a>
182179
183180
184181### Code sample indicated by indentation
185182
186183Code preceded by four blank spaces per line:
187184
188185 if (a) {
189186 b;
190187 }
191188
192189Code preceded by seven blank spaces per line:
193190
194191 fn main () {
195192
196193 }
197194
198195In both cases, the code is correctly formatted during both preview and final presentation.
199196
200197 [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;
201198 [2]:
202199 [3]:
203200
204201## Images ##
205202
206203File uploaded successfully. at this address: /media/get/link_image2.png
207204
208205![Image 2](/media/get/link_image2.png)
diff view generated by jsdifflib

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

# Sandbox

Use this page to experiment with wiki markup. 
* [New page](my-new-page)

## 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: 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)

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.