Skip to content

Commit ed34592

Browse files
committed
[css2] Now accepts {URL}...{} in the property database to make links
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%402012
1 parent c6ceb1f commit ed34592

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

css2/bin/mkdescidx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/local/bin/perl
22
# Index of descriptor names.
33
# Arnaud Le Hors lehors@w3.org/Ian Jacobs ij@w3.org
4-
# $Id: mkdescidx,v 2.2 1998-05-13 10:59:02 bbos Exp $
4+
# $Id: mkdescidx,v 2.3 2003-01-17 21:27:30 bbos Exp $
55
use English;
66

77

@@ -68,6 +68,7 @@ sub cleanup {
6868
$arg =~ s/[&]/\&amp\;/gs;
6969
$arg =~ s/[<]/\&lt\;/gs;
7070
$arg =~ s/[>]/\&gt\;/gs;
71+
$arg =~ s/\{([^\}]*)\}([^{]*)\{\}/<a href=\"$1\">$2<\/a>/g;
7172
return "$arg";
7273
}
7374

css2/bin/mkpropidx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/local/bin/perl
22
# Index of property names.
33
# Arnaud Le Hors lehors@w3.org/Ian Jacobs ij@w3.org
4-
# $Id: mkpropidx,v 2.11 2002-12-16 20:42:15 bbos Exp $
4+
# $Id: mkpropidx,v 2.12 2003-01-17 21:27:31 bbos Exp $
55
use English;
66

77

@@ -72,6 +72,7 @@ sub cleanup {
7272
$arg =~ s/[&]/\&amp\;/gs;
7373
$arg =~ s/[<]/\&lt\;/gs;
7474
$arg =~ s/[>]/\&gt\;/gs;
75+
$arg =~ s/\{([^\}]*)\}([^{]*)\{\}/<a href=\"$1\">$2<\/a>/g;
7576
return "$arg";
7677
}
7778

css2/bin/pextr

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# <span class="propinst-name">&lt;'name'&gt;</span>
1414
#
1515
# Ian Jacobs - ij@w3.org (Based on work by Arnaud Le Hors)
16-
# $Id: pextr,v 1.25 2002-11-28 21:27:53 bbos Exp $
16+
# $Id: pextr,v 1.26 2003-01-17 21:27:31 bbos Exp $
1717
#
1818

1919
$PROGNAME = substr($0, rindex($0, "/") + 1);
@@ -80,12 +80,17 @@ print output "</dl>\n";
8080
print output "</div>\n\n";
8181
}
8282

83+
sub clean {
84+
$_[0] =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
85+
$_[0] =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
86+
$_[0] =~ s/\{([^\}]*)\}([^{]*)\{\}/<a href=\"$1\">$2<\/a>/g;
87+
return $_[0];
88+
}
89+
8390
# Include an nbsp before TD since CSS not used to
8491
# align tables yet.
8592
sub format_values {
86-
$values = $_[0];
87-
$values =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
88-
$values =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">&lt;'$1'&gt;<\/span>/g;
93+
$values = clean($_[0]);
8994
$values =~ s/inherit/<span class=\"value-inst-inherit\">inherit<\/span>/g;
9095
print output "<tr valign=baseline>";
9196
print output "<td><em>Value:</em>&nbsp;&nbsp;";
@@ -94,37 +99,32 @@ print output "<td>$values\n";
9499

95100
sub format_init {
96101
#Note that in the case of properties, <> are removed in text.
97-
$init = $_[0];
102+
$init = clean($_[0]);
98103
$init =~ s/XX/not defined for shorthand properties/g;
99-
$init =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
100-
$init =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
101104
print output "<tr valign=baseline>";
102105
print output "<td><em>Initial:</em>&nbsp;&nbsp;";
103106
print output "<td>$init\n";
104107
}
105108

106109
sub format_applies {
107110
#Note that in the case of properties, <> are removed in text.
108-
$applies = $_[0];
111+
$applies = clean($_[0]);
109112
$applies =~ s/\*/all elements/g;
110-
$applies =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
111-
$applies =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
112113
print output "<tr valign=baseline>";
113114
print output "<td><em>Applies to:</em>&nbsp;&nbsp;";
114115
print output "<td>$applies\n";
115116
}
116117

117118
sub format_inherited {
119+
$inherited = clean($_[0]);
118120
print output "<tr valign=baseline>";
119121
print output "<td><em>Inherited:</em>&nbsp;&nbsp;";
120-
print output "<td>$_[0]\n";
122+
print output "<td>$inherited\n";
121123
}
122124

123125
sub format_percentages {
124126
#Note that in the case of properties, <> are removed in text.
125-
$perc = $_[0];
126-
$perc =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
127-
$perc =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">'$1'<\/span>/g;
127+
$perc = clean($_[0]);
128128
print output "<tr valign=baseline>";
129129
print output "<td><em>Percentages:</em>&nbsp;&nbsp;";
130130
print output "<td>$perc\n";
@@ -147,9 +147,7 @@ sub format_media {
147147
}
148148

149149
sub format_compval {
150-
$values = $_[0];
151-
$values =~ s/<([^>']*)>/<span class=\"value-inst-$1\">&lt;$1&gt;<\/span>/g;
152-
$values =~ s/<[']([^']*)[']>/<span class=\"propinst-$1\">&lt;'$1'&gt;<\/span>/g;
150+
$values = clean($_[0]);
153151
$values =~ s/inherit/<span class=\"value-inst-inherit\">inherit<\/span>/g;
154152
print output "<tr valign=baseline>";
155153
print output "<td><em>Computed&nbsp;value:</em>&nbsp;&nbsp;";

0 commit comments

Comments
 (0)