@@ -51,59 +51,70 @@ function ticket_link (state, silent) {
51
51
state . pos = start
52
52
state . posMax = end
53
53
54
- if ( state . env . tickets [ item_link . groups . model_id ] ?? null ) {
55
54
56
- const span_o = state . push ( 'span_open' , 'span' , 1 )
57
- span_o . attrPush ( [ 'class' , 'text-inline' ] )
55
+ if (
56
+ ( ! state . env . tickets ?? null )
57
+ || ( ! state . env . tickets [ item_link . groups . model_id ] ?? null )
58
+ ) {
58
59
59
- const anchor_o = state . push ( 'a_open ' , 'a ' , 1 )
60
- anchor_o . attrPush ( [ 'href' , state . env . tickets [ item_link . groups . model_id ] . url ] )
60
+ const failed_token = state . push ( 'text ' , '' , 0 )
61
+ failed_token . content = item_link . groups . markdown
61
62
63
+ continue
62
64
63
- const icon_o = state . push ( 'icon_open' , 'span' , 1 )
64
- icon_o . attrPush ( [
65
- 'class' , 'badge-icon ticket-status-icon ticket-status-icon-' + String ( state . env . tickets [ item_link . groups . model_id ] . status ) . toLowerCase ( ) . replace ( ' ' , '_' ) . replace ( '(' , '' ) . replace ( ')' , '' )
66
- ] )
65
+ }
67
66
68
- const icon_t = state . push ( 'html_inline' , '' , 0 )
69
67
70
- icon_t . content = renderToStaticMarkup (
71
- < IconLoader
72
- name = { 'ticket_status_new' }
73
- />
74
- )
68
+ const span_o = state . push ( 'span_open' , 'span' , 1 )
69
+ span_o . attrPush ( [ 'class' , 'text-inline' ] )
75
70
76
- const icon_c = state . push ( 'icon_close' , 'span' , - 1 )
71
+ const anchor_o = state . push ( 'a_open' , 'a' , 1 )
72
+ anchor_o . attrPush ( [ 'href' , state . env . tickets [ item_link . groups . model_id ] . url ] )
77
73
78
74
79
- const ref_o = state . push ( 'ref_open' , 'span' , 1 )
80
- ref_o . attrPush ( [ "class" , "sub-script metadata" ] )
75
+ const icon_o = state . push ( 'icon_open' , 'span' , 1 )
76
+ icon_o . attrPush ( [
77
+ 'class' , 'badge-icon ticket-status-icon ticket-status-icon-' + String ( state . env . tickets [ item_link . groups . model_id ] . status ) . toLowerCase ( ) . replace ( ' ' , '_' ) . replace ( '(' , '' ) . replace ( ')' , '' )
78
+ ] )
81
79
82
- const ref_t = state . push ( 'text' , '' , 0 )
83
- ref_t . content = ' #' + String ( item_link . groups . model_id ) + ' '
80
+ const icon_t = state . push ( 'html_inline' , '' , 0 )
84
81
85
- const ref_c = state . push ( 'ref_close' , 'span' , - 1 )
82
+ icon_t . content = renderToStaticMarkup (
83
+ < IconLoader
84
+ name = { 'ticket_status_new' }
85
+ />
86
+ )
86
87
88
+ const icon_c = state . push ( 'icon_close' , 'span' , - 1 )
87
89
88
- const anchor_t = state . push ( 'text' , '' , 0 )
89
- anchor_t . content = state . env . tickets [ item_link . groups . model_id ] . title
90
90
91
+ const ref_o = state . push ( 'ref_open' , 'span' , 1 )
92
+ ref_o . attrPush ( [ "class" , "sub-script metadata" ] )
91
93
92
- const item_o = state . push ( 'item_open ' , 'span ' , 1 )
93
- item_o . attrPush ( [ "class" , "sub-script metadata" ] )
94
+ const ref_t = state . push ( 'text ' , '' , 0 )
95
+ ref_t . content = ' #' + String ( item_link . groups . model_id ) + ' '
94
96
95
- const item_t = state . push ( 'text' , '' , 0 )
96
- item_t . content = ', ' + String ( state . env . tickets [ item_link . groups . model_id ] . ticket_type ) + ' '
97
+ const ref_c = state . push ( 'ref_close' , 'span' , - 1 )
97
98
98
- const item_c = state . push ( 'item_close' , 'span' , - 1 )
99
99
100
+ const anchor_t = state . push ( 'text' , '' , 0 )
101
+ anchor_t . content = state . env . tickets [ item_link . groups . model_id ] . title
100
102
101
- const anchor_c = state . push ( 'a_close' , 'a' , - 1 )
102
103
103
-
104
- const span_c = state . push ( 'span_close' , 'span' , - 1 )
104
+ const item_o = state . push ( 'item_open' , 'span' , 1 )
105
+ item_o . attrPush ( [ "class" , "sub-script metadata" ] )
106
+
107
+ const item_t = state . push ( 'text' , '' , 0 )
108
+ item_t . content = ', ' + String ( state . env . tickets [ item_link . groups . model_id ] . ticket_type ) + ' '
109
+
110
+ const item_c = state . push ( 'item_close' , 'span' , - 1 )
111
+
112
+
113
+ const anchor_c = state . push ( 'a_close' , 'a' , - 1 )
114
+
115
+
116
+ const span_c = state . push ( 'span_close' , 'span' , - 1 )
105
117
106
- }
107
118
108
119
}
109
120
0 commit comments