Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3c2cca9

Browse files
divider multi line (linefeed) plantuml export
1 parent7afa955 commit3c2cca9

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

‎command-line-test/data/dividers.puml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ participant "New Lifeline0" as New_Lifeline__0
77

88
[->New_Lifeline__0: message
99

10-
==divider00==
10+
=="divider00"==
1111
New_Lifeline__0->]: message
1212
' end lifeline New_Lifeline__0
1313
New_Lifeline__0->]: message
1414
' end lifeline New_Lifeline__0
1515

16-
==divider01==
16+
=="divider01"==
1717

18-
==divider02==
18+
=="divider02\nmulti line"==
1919
New_Lifeline__0->]: message
2020
' end lifeline New_Lifeline__0
2121

‎daisy_sequence/js/diagram.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,10 @@ module.exports = class Diagram{
233233
constident_name=ObjectUtil.get_property_from_path(element,'work.ident_name');
234234
returnident_name;
235235
};
236-
constfunc_lifeline_name_=function(str)
236+
constfunc_element_printname_linefeed_=function(str)
237237
{
238+
// plantuml向けに改行をエスケープシーケンスへ置き換える。
239+
// ついでに末尾の不要な改行を除去する。
238240
str=str.replace(/[\n]+$/g,"");
239241
str=str.replace(/\n/g,"\\n");
240242
return'"'+str+'"';
@@ -488,7 +490,7 @@ module.exports = class Diagram{
488490
});
489491
for(leti=0;i<lifelines.length;i++){
490492
strdata+=sprintf("participant %s as %s\n",
491-
func_lifeline_name_(lifelines[i].text),
493+
func_element_printname_linefeed_(lifelines[i].text),
492494
func_get_lifeline_ident_name_(lifelines[i]));
493495
}
494496
strdata+="\n";
@@ -580,7 +582,7 @@ module.exports = class Diagram{
580582
strdata=func_plantuml_fragment_(strdata,plantuml_elems[i],diagram,plantuml_opt);
581583
break;
582584
case'divider':
583-
strdata+=sprintf("\n== %s ==\n",plantuml_elems[i].text);
585+
strdata+=sprintf("\n== %s ==\n",func_element_printname_linefeed_(plantuml_elems[i].text));
584586
break;
585587
default:
586588
}

‎fileformat-example/dividers.daisysequence

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
{
3838
"kind": "message",
3939
"id": 2,
40-
"y":187,
40+
"y":174,
4141
"start": {
4242
"position_x": 265,
4343
"lifeline_id": 0
@@ -60,20 +60,20 @@
6060
"kind": "divider",
6161
"id": 4,
6262
"x": 253,
63-
"y":223,
63+
"y":211,
6464
"text": "divider01"
6565
},
6666
{
6767
"kind": "divider",
6868
"id": 5,
6969
"x": 339,
70-
"y":260,
71-
"text": "divider02"
70+
"y":257,
71+
"text": "divider02\nmulti line"
7272
},
7373
{
7474
"kind": "message",
7575
"id": 6,
76-
"y":328,
76+
"y":342,
7777
"start": {
7878
"position_x": 269,
7979
"lifeline_id": 0
@@ -88,7 +88,7 @@
8888
{
8989
"kind": "message",
9090
"id": 7,
91-
"y":160,
91+
"y":147,
9292
"start": {
9393
"position_x": 273,
9494
"lifeline_id": 0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp