Fossil SCM

Allow the target attribute on <a> markup. Ticket [577663c2727505a]

drh 2011-02-20 20:44 trunk
Commit fde81c6109780dec90cd298bb9e5e25907815f1d
1 file changed +9 -6
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -54,15 +54,16 @@
5454
#define ATTR_NAME 17
5555
#define ATTR_ROWSPAN 18
5656
#define ATTR_SIZE 19
5757
#define ATTR_SRC 20
5858
#define ATTR_START 21
59
-#define ATTR_TYPE 22
60
-#define ATTR_VALIGN 23
61
-#define ATTR_VALUE 24
62
-#define ATTR_VSPACE 25
63
-#define ATTR_WIDTH 26
59
+#define ATTR_TARGET 22
60
+#define ATTR_TYPE 23
61
+#define ATTR_VALIGN 24
62
+#define ATTR_VALUE 25
63
+#define ATTR_VSPACE 26
64
+#define ATTR_WIDTH 27
6465
#define AMSK_ALIGN 0x0000001
6566
#define AMSK_ALT 0x0000002
6667
#define AMSK_BGCOLOR 0x0000004
6768
#define AMSK_BORDER 0x0000008
6869
#define AMSK_CELLPADDING 0x0000010
@@ -85,10 +86,11 @@
8586
#define AMSK_VALIGN 0x0200000
8687
#define AMSK_VALUE 0x0400000
8788
#define AMSK_VSPACE 0x0800000
8889
#define AMSK_WIDTH 0x1000000
8990
#define AMSK_CLASS 0x2000000
91
+#define AMSK_TARGET 0x4000000
9092
9193
static const struct AllowedAttribute {
9294
const char *zName;
9395
unsigned int iMask;
9496
} aAttribute[] = {
@@ -112,10 +114,11 @@
112114
{ "name", AMSK_NAME, },
113115
{ "rowspan", AMSK_ROWSPAN, },
114116
{ "size", AMSK_SIZE, },
115117
{ "src", AMSK_SRC, },
116118
{ "start", AMSK_START, },
119
+ { "target", AMSK_TARGET, },
117120
{ "type", AMSK_TYPE, },
118121
{ "valign", AMSK_VALIGN, },
119122
{ "value", AMSK_VALUE, },
120123
{ "vspace", AMSK_VSPACE, },
121124
{ "width", AMSK_WIDTH, },
@@ -238,11 +241,11 @@
238241
short int iType; /* The MUTYPE_* code */
239242
int allowedAttr; /* Allowed attributes on this markup */
240243
} aMarkup[] = {
241244
{ 0, MARKUP_INVALID, 0, 0 },
242245
{ "a", MARKUP_A, MUTYPE_HYPERLINK,
243
- AMSK_HREF|AMSK_NAME|AMSK_CLASS },
246
+ AMSK_HREF|AMSK_NAME|AMSK_CLASS|AMSK_TARGET },
244247
{ "address", MARKUP_ADDRESS, MUTYPE_BLOCK, 0 },
245248
{ "b", MARKUP_B, MUTYPE_FONT, 0 },
246249
{ "big", MARKUP_BIG, MUTYPE_FONT, 0 },
247250
{ "blockquote", MARKUP_BLOCKQUOTE, MUTYPE_BLOCK, 0 },
248251
{ "br", MARKUP_BR, MUTYPE_SINGLE, AMSK_CLEAR },
249252
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -54,15 +54,16 @@
54 #define ATTR_NAME 17
55 #define ATTR_ROWSPAN 18
56 #define ATTR_SIZE 19
57 #define ATTR_SRC 20
58 #define ATTR_START 21
59 #define ATTR_TYPE 22
60 #define ATTR_VALIGN 23
61 #define ATTR_VALUE 24
62 #define ATTR_VSPACE 25
63 #define ATTR_WIDTH 26
 
64 #define AMSK_ALIGN 0x0000001
65 #define AMSK_ALT 0x0000002
66 #define AMSK_BGCOLOR 0x0000004
67 #define AMSK_BORDER 0x0000008
68 #define AMSK_CELLPADDING 0x0000010
@@ -85,10 +86,11 @@
85 #define AMSK_VALIGN 0x0200000
86 #define AMSK_VALUE 0x0400000
87 #define AMSK_VSPACE 0x0800000
88 #define AMSK_WIDTH 0x1000000
89 #define AMSK_CLASS 0x2000000
 
90
91 static const struct AllowedAttribute {
92 const char *zName;
93 unsigned int iMask;
94 } aAttribute[] = {
@@ -112,10 +114,11 @@
112 { "name", AMSK_NAME, },
113 { "rowspan", AMSK_ROWSPAN, },
114 { "size", AMSK_SIZE, },
115 { "src", AMSK_SRC, },
116 { "start", AMSK_START, },
 
117 { "type", AMSK_TYPE, },
118 { "valign", AMSK_VALIGN, },
119 { "value", AMSK_VALUE, },
120 { "vspace", AMSK_VSPACE, },
121 { "width", AMSK_WIDTH, },
@@ -238,11 +241,11 @@
238 short int iType; /* The MUTYPE_* code */
239 int allowedAttr; /* Allowed attributes on this markup */
240 } aMarkup[] = {
241 { 0, MARKUP_INVALID, 0, 0 },
242 { "a", MARKUP_A, MUTYPE_HYPERLINK,
243 AMSK_HREF|AMSK_NAME|AMSK_CLASS },
244 { "address", MARKUP_ADDRESS, MUTYPE_BLOCK, 0 },
245 { "b", MARKUP_B, MUTYPE_FONT, 0 },
246 { "big", MARKUP_BIG, MUTYPE_FONT, 0 },
247 { "blockquote", MARKUP_BLOCKQUOTE, MUTYPE_BLOCK, 0 },
248 { "br", MARKUP_BR, MUTYPE_SINGLE, AMSK_CLEAR },
249
--- src/wikiformat.c
+++ src/wikiformat.c
@@ -54,15 +54,16 @@
54 #define ATTR_NAME 17
55 #define ATTR_ROWSPAN 18
56 #define ATTR_SIZE 19
57 #define ATTR_SRC 20
58 #define ATTR_START 21
59 #define ATTR_TARGET 22
60 #define ATTR_TYPE 23
61 #define ATTR_VALIGN 24
62 #define ATTR_VALUE 25
63 #define ATTR_VSPACE 26
64 #define ATTR_WIDTH 27
65 #define AMSK_ALIGN 0x0000001
66 #define AMSK_ALT 0x0000002
67 #define AMSK_BGCOLOR 0x0000004
68 #define AMSK_BORDER 0x0000008
69 #define AMSK_CELLPADDING 0x0000010
@@ -85,10 +86,11 @@
86 #define AMSK_VALIGN 0x0200000
87 #define AMSK_VALUE 0x0400000
88 #define AMSK_VSPACE 0x0800000
89 #define AMSK_WIDTH 0x1000000
90 #define AMSK_CLASS 0x2000000
91 #define AMSK_TARGET 0x4000000
92
93 static const struct AllowedAttribute {
94 const char *zName;
95 unsigned int iMask;
96 } aAttribute[] = {
@@ -112,10 +114,11 @@
114 { "name", AMSK_NAME, },
115 { "rowspan", AMSK_ROWSPAN, },
116 { "size", AMSK_SIZE, },
117 { "src", AMSK_SRC, },
118 { "start", AMSK_START, },
119 { "target", AMSK_TARGET, },
120 { "type", AMSK_TYPE, },
121 { "valign", AMSK_VALIGN, },
122 { "value", AMSK_VALUE, },
123 { "vspace", AMSK_VSPACE, },
124 { "width", AMSK_WIDTH, },
@@ -238,11 +241,11 @@
241 short int iType; /* The MUTYPE_* code */
242 int allowedAttr; /* Allowed attributes on this markup */
243 } aMarkup[] = {
244 { 0, MARKUP_INVALID, 0, 0 },
245 { "a", MARKUP_A, MUTYPE_HYPERLINK,
246 AMSK_HREF|AMSK_NAME|AMSK_CLASS|AMSK_TARGET },
247 { "address", MARKUP_ADDRESS, MUTYPE_BLOCK, 0 },
248 { "b", MARKUP_B, MUTYPE_FONT, 0 },
249 { "big", MARKUP_BIG, MUTYPE_FONT, 0 },
250 { "blockquote", MARKUP_BLOCKQUOTE, MUTYPE_BLOCK, 0 },
251 { "br", MARKUP_BR, MUTYPE_SINGLE, AMSK_CLEAR },
252

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button