Version at: 20/11/2022, 16:39 vs. version at: 11/05/2023, 11:49
11Use this page to experiment with editing the Tatoeba wiki.
22
33# Sandbox
4
5Test
46
57## Bulleted lists ##
68Nested bulleted list with two spaces for the second level of indentation and four spaces for the fourth:
79
810* a
911 * a.b
1012 * a.b.c
1113 * a.v
1214* z
1315
1416That list looks correct in the preview and correct in the final presentation.
1517
1618Another list where there are two spaces for each level of indentation:
1719
1820* a
1921 * a.b
2022 * a.b.c
2123 * a.v
2224* z
2325
2426Note that that list looks messed up in the preview, but correct in the final presentation.
2527
2628Here's one where there are four spaces for each level of indentation:
2729
2830* a
2931 * a.b
3032 * a.b.c
3133 * a.v
3234* z
3335
3436That list looks correct in both the preview and the final presentation.
3537
3638##Outlines
3739
3840Only two levels of indentation are shown in the "How to Format Text" box, but in reality, more are available:
3941
4042###Third level of indentation
4143####Fourth level of indentation
4244#####Fifth level of indentation
4345
4446However, the fifth level looks smaller than body text.
4547
4648###Heading that's got an apostrophe
4749
4850The link to the heading will be truncated by the apostrophe, and clicking on the link will not take you to the heading.
4951
5052###Don't assume that apostrophes are handled correctly in headings
5153
5254In 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.
5355
5456##Code
5557
5658We 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.
5759
5860###Backticks
5961Code sample (note that the format differs between preview mode and final presentation):
6062
6163`
6264if (a)
6365 b
6466else
6567 c
6668`
6769
6870###Triple backticks
6971
7072This section is "fenced off" by triple backticks (see [GitHub Flavored Markdown](https://help.github.com/articles/github-flavored-markdown)):
7173
7274```
7375if (a)
7476 b
7577else
7678 c
7779```
7880
7981but the formatting is not preserved.
8082
8183###Blockquote
8284
8385The blockquote markup doesn't do the job either, since again the format differs between preview mode and final presentation:
8486
8587>>if (a)
8688>> b
8789>>else
8890>> c
8991
9092###XML-style blockquote tag
9193Here's an attempt to use an XML-style blockquote tag:
9294
9395<blockquote>
9496if (a)
9597 b
9698else
9799 c
98100</blockquote>
99101
100102The blockquote tag disappears altogether, but does not prevent the text it surrounds from being reformatted.
101103
102104##Escaping characters
103105
104106We need ways of escaping various characters:
105107
106108###Asterisk
107109
108110Here's a word that ends with an asterisk*: asterisk\*
109111
110112Here's a word that starts and ends with an *asterisk*: \*asterisk\*
111113
112114###Underscore
113115Mention a name that contains a single underscore:
114116
115117a_b
116118
117119It appears correctly. But mention a name that contains an underscore twice:
118120
119121a_b a_b
120122
121123It appears as:
122124
123125ab ab
124126
125127where the first b and the second a are italicized.
126128
127129Solution: Use a backslash in front of each underscore:
128130
129131a\\\_b a\\\_b
130132
131133to produce this output:
132134
133135a\_b a\_b
134136
135137###Parenthesis
136138
137139Say 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.
138140
139141[ t e x t ] ( h t t p : / / example . com )
140142
141143Solution: 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.)
142144
143145\\[text\\]\\(http://example.com\\)
144146
145147Output:
146148
147149\[text\]\(http://example.com\)
148150
149151##Bookmarklet code
150152First bookmarklet test (which succeeds in both preview and presentation modes):
151153
152154[test][1]
153155
154156
155157
156158
157159Second bookmarklet test (which succeeds only in preview mode):
158160
159161[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};})
160162
161163Third bookmarklet test (which succeeds only in preview mode; in presentation mode it points to http://en.wiki.tatoeba.org/articles/show/sandbox):
162164
163165[test 2][2]
164166
165167
166168javascript: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};}
167169
168170Fourth 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):
169171
170172[test 3][3]
171173
172174
173175javascript: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.")};}
174176
175177Fifth bookmarklet test, in which I use backslashes to escape all backslashes, asterisks, underscores, open-square-brackets, close-square-brackets, open-parentheses, close-parentheses:
176178
177179javascript: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."\)};}
178180
179181This 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.)
180182
181183However, I'm not able to get it to work right in a link:
182184
183185[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."\)};})
184186
185187##HTML
186188<a href="http://www.example.com">link</a>
187189
188190<ul>
189191<li><strong>strong</strong></li>
190192<li><em>em</em></li>
191193</ul>
192194
193195<iframe width="560" height="315" src="https://www.youtube.com/embed/ac9SmJuwHqk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> // embedding videos is not possible
194196
195197### Code sample indicated by indentation
196198
197199Code preceded by four blank spaces per line:
198200
199201 if (a) {
200202 b;
201203 }
202204
203205Code preceded by seven blank spaces per line:
204206
205207 fn main () {
206208
207209 }
208210
209211In both cases, the code is correctly formatted during both preview and final presentation.
210212
211213
212214
213215
214216
215217## Images ##
216218
217219How to add an image:
218220
219221(1) Click the "Add an image" button in the wiki editor bar:
220222
221223![add an image button with border](/media/get/add_an_image_button_with_border.png)
222224
223225This will bring up a dialog:
224226
225227![add an image dialog](/media/get/add_an_image_dialog_with_border.png)
226228
227229(2) Click on the "Browse" button.
228230
229231(3) Click on the "upload" button.
230232
231233(4) Copy the image address from the "Enter image address or upload one" field and save it somewhere for later use.
232234
233235(5) Click "OK".
234236
235237(6) Write a link that uses the text you saved in step 4. For example, if your text is "/media/get/add_an_image_dialog_with_border.png", write a link that looks like this:
236238
237239`![add an image dialog](/media/get/add_an_image_dialog_with_border.png)`
238240
239241(7) Save your changes.
240242
241243 [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;
242244
243245
244246
diff view generated by jsdifflib

Version at: 20/11/2022, 16:39

Use this page to experiment with editing the Tatoeba wiki.

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

###Asterisk

Here's a word that ends with an asterisk*: asterisk\*

Here's a word that starts and ends with an *asterisk*: \*asterisk\*

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

<ul>
<li><strong>strong</strong></li>
<li><em>em</em></li>
</ul>

<iframe width="560" height="315" src="https://www.youtube.com/embed/ac9SmJuwHqk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> // embedding videos is not possible

### 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.





## Images ##

How to add an image:

(1) Click the "Add an image" button in the wiki editor bar:

![add an image button with border](/media/get/add_an_image_button_with_border.png)

This will bring up a dialog:

![add an image dialog](/media/get/add_an_image_dialog_with_border.png)

(2) Click on the "Browse" button.

(3) Click on the "upload" button.

(4) Copy the image address from the "Enter image address or upload one" field and save it somewhere for later use.

(5) Click "OK".

(6) Write a link that uses the text you saved in step 4. For example, if your text is "/media/get/add_an_image_dialog_with_border.png", write a link that looks like this:

`![add an image dialog](/media/get/add_an_image_dialog_with_border.png)`

(7) Save your changes.

  [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;


version at: 11/05/2023, 11:49

Use this page to experiment with editing the Tatoeba wiki.

# Sandbox

Test

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

###Asterisk

Here's a word that ends with an asterisk*: asterisk\*

Here's a word that starts and ends with an *asterisk*: \*asterisk\*

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

<ul>
<li><strong>strong</strong></li>
<li><em>em</em></li>
</ul>

<iframe width="560" height="315" src="https://www.youtube.com/embed/ac9SmJuwHqk" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> // embedding videos is not possible

### 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.





## Images ##

How to add an image:

(1) Click the "Add an image" button in the wiki editor bar:

![add an image button with border](/media/get/add_an_image_button_with_border.png)

This will bring up a dialog:

![add an image dialog](/media/get/add_an_image_dialog_with_border.png)

(2) Click on the "Browse" button.

(3) Click on the "upload" button.

(4) Copy the image address from the "Enter image address or upload one" field and save it somewhere for later use.

(5) Click "OK".

(6) Write a link that uses the text you saved in step 4. For example, if your text is "/media/get/add_an_image_dialog_with_border.png", write a link that looks like this:

`![add an image dialog](/media/get/add_an_image_dialog_with_border.png)`

(7) Save your changes.

  [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;


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.