source: osm/applications/editors/josm/plugins/public_transport/resources/html2wiki.awk@ 36017

Last change on this file since 36017 was 34718, checked in by stoecker, 6 years ago

fix wrong deletion

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.