source: osm/applications/editors/josm/plugins/mirrored_download/resources/html2wiki.awk@ 29723

Last change on this file since 29723 was 27678, checked in by roland, 13 years ago

Started plugin mirrored_download.

File size: 881 bytes
Line 
1{
2 buf = $0;
3 result = "";
4 match_idx = match(buf, "\<a id=\"[^\"]*\"\/\>");
5 while (match_idx > 0)
6 {
7 result = result substr(buf, 0, match_idx);
8 result = result "<span id=\"" substr(buf, match_idx+7, RLENGTH-10) "\"></span>";
9 buf = substr(buf, match_idx+RLENGTH);
10 match_idx = match(buf, "\<a id=\"[^\"]*\"\/\>");
11 };
12 result = result buf
13
14 buf = result;
15 result = "";
16 match_idx = match(buf, "\<a href=\"[^\"]*\"\>");
17 while (match_idx > 0)
18 {
19 result = result substr(buf, 0, match_idx);
20 result = result "[[" substr(buf, match_idx+9, RLENGTH-11) "|";
21 buf = substr(buf, match_idx+RLENGTH);
22 match_idx = match(buf, "\<\/a\>");
23 result = result substr(buf, 0, match_idx);
24 result = result "]]";
25 buf = substr(buf, match_idx+RLENGTH);
26 match_idx = match(buf, "\<a href=\"[^\"]*\"\>");
27 };
28 result = result buf
29 print result;
30}
Note: See TracBrowser for help on using the repository browser.