@@ -72,24 +72,28 @@ let jiraTagMatchDecorator: IMatchDecoratorRef = { ref: null }
72
72
let jiraUrlMatchDecorator : IMatchDecoratorRef = { ref : null }
73
73
74
74
function buildMatchDecorators ( ) {
75
- jiraTagMatchDecorator . ref = new MatchDecorator ( {
76
- regexp : new RegExp ( `${ SettingsData . inlineIssuePrefix } (${ COMPACT_SYMBOL } ?)([A-Z0-9]+-[0-9]+)` , 'g' ) ,
77
- decoration : ( match : RegExpExecArray , view : EditorView , pos : number ) => {
78
- const compact = ! ! match [ 1 ]
79
- const key = match [ 2 ]
80
- const tagLength = match [ 0 ] . length
81
- if ( ! isEditorInLivePreviewMode ( view ) || isCursorInsideTag ( view , pos , tagLength ) || isSelectionContainsTag ( view , pos , tagLength ) ) {
82
- return Decoration . mark ( {
83
- tagName : 'div' ,
84
- class : 'HyperMD-codeblock HyperMD-codeblock-bg jira-issue-inline-mark' ,
85
- } )
86
- } else {
87
- return Decoration . replace ( {
88
- widget : new InlineIssueWidget ( key , compact ) ,
89
- } )
75
+ if ( SettingsData . inlineIssuePrefix !== '' ) {
76
+ jiraTagMatchDecorator . ref = new MatchDecorator ( {
77
+ regexp : new RegExp ( `${ SettingsData . inlineIssuePrefix } (${ COMPACT_SYMBOL } ?)([A-Z0-9]+-[0-9]+)` , 'g' ) ,
78
+ decoration : ( match : RegExpExecArray , view : EditorView , pos : number ) => {
79
+ const compact = ! ! match [ 1 ]
80
+ const key = match [ 2 ]
81
+ const tagLength = match [ 0 ] . length
82
+ if ( ! isEditorInLivePreviewMode ( view ) || isCursorInsideTag ( view , pos , tagLength ) || isSelectionContainsTag ( view , pos , tagLength ) ) {
83
+ return Decoration . mark ( {
84
+ tagName : 'div' ,
85
+ class : 'HyperMD-codeblock HyperMD-codeblock-bg jira-issue-inline-mark' ,
86
+ } )
87
+ } else {
88
+ return Decoration . replace ( {
89
+ widget : new InlineIssueWidget ( key , compact ) ,
90
+ } )
91
+ }
90
92
}
91
- }
92
- } )
93
+ } )
94
+ } else {
95
+ jiraTagMatchDecorator . ref = null
96
+ }
93
97
94
98
if ( SettingsData . inlineIssueUrlToTag ) {
95
99
const urls : string [ ] = [ ]
0 commit comments