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