File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
main/modals/PreferencesModal Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -145,11 +145,13 @@ class Markdown {
145
145
const deflate = require ( 'markdown-it-plantuml/lib/deflate' )
146
146
this . md . use ( require ( 'markdown-it-plantuml' ) , '' , {
147
147
generateSource : function ( umlCode ) {
148
+ const stripTrailingSlash = ( url ) => url . endsWith ( '/' ) ? url . slice ( 0 , - 1 ) : url
149
+ const serverAddress = stripTrailingSlash ( config . preview . plantUMLServerAddress ) + '/svg'
148
150
const s = unescape ( encodeURIComponent ( umlCode ) )
149
151
const zippedCode = deflate . encode64 (
150
152
deflate . zip_deflate ( `@startuml\n${ s } \n@enduml` , 9 )
151
153
)
152
- return `http://www.plantuml.com/plantuml/svg /${ zippedCode } `
154
+ return `${ serverAddress } /${ zippedCode } `
153
155
}
154
156
} )
155
157
Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ class UiTab extends React.Component {
94
94
latexInlineClose : this . refs . previewLatexInlineClose . value ,
95
95
latexBlockOpen : this . refs . previewLatexBlockOpen . value ,
96
96
latexBlockClose : this . refs . previewLatexBlockClose . value ,
97
+ plantUMLServerAddress : this . refs . previewPlantUMLServerAddress . value ,
97
98
scrollPastEnd : this . refs . previewScrollPastEnd . checked ,
98
99
smartQuotes : this . refs . previewSmartQuotes . checked ,
99
100
sanitize : this . refs . previewSanitize . value
@@ -544,6 +545,19 @@ class UiTab extends React.Component {
544
545
/>
545
546
</ div >
546
547
</ div >
548
+ < div styleName = 'group-section' >
549
+ < div styleName = 'group-section-label' >
550
+ { i18n . __ ( 'PlantUML Server' ) }
551
+ </ div >
552
+ < div styleName = 'group-section-control' >
553
+ < input styleName = 'group-section-control-input'
554
+ ref = 'previewPlantUMLServerAddress'
555
+ value = { config . preview . plantUMLServerAddress }
556
+ onChange = { ( e ) => this . handleUIChange ( e ) }
557
+ type = 'text'
558
+ />
559
+ </ div >
560
+ </ div >
547
561
548
562
< div styleName = 'group-control' >
549
563
< button styleName = 'group-control-rightButton'
You can’t perform that action at this time.
0 commit comments