@@ -1023,7 +1023,7 @@ hoge`;
10231023 const input = '[official instance](https://misskey.io/@ai).' ;
10241024 const output = [
10251025 LINK (
1026- false ,
1026+ 'plain' ,
10271027 N_URL ( 'https://misskey.io/@ai' ) ,
10281028 [ TEXT ( 'official instance' ) ]
10291029 ) ,
@@ -1036,7 +1036,7 @@ hoge`;
10361036 const input = '?[official instance](https://misskey.io/@ai).' ;
10371037 const output = [
10381038 LINK (
1039- true ,
1039+ 'silent' ,
10401040 N_URL ( 'https://misskey.io/@ai' ) ,
10411041 [ TEXT ( 'official instance' ) ]
10421042 ) ,
@@ -1049,7 +1049,7 @@ hoge`;
10491049 const input = '[#藍ちゃファンクラブ](<https://misskey.io/explore/tags/藍ちゃファンクラブ>).' ;
10501050 const output = [
10511051 LINK (
1052- false ,
1052+ 'plain' ,
10531053 N_URL ( 'https://misskey.io/explore/tags/藍ちゃファンクラブ' , true ) ,
10541054 [ TEXT ( '#藍ちゃファンクラブ' ) ]
10551055 ) ,
@@ -1058,13 +1058,52 @@ hoge`;
10581058 assert . deepStrictEqual ( mfm . parse ( input ) , output ) ;
10591059 } ) ;
10601060
1061+ it ( 'embed flag' , ( ) => {
1062+ const input = '.' ;
1063+ const output = [
1064+ LINK (
1065+ 'embed' ,
1066+ N_URL ( 'https://raw.githubusercontent.com/syuilo/ai/master/ai.svg' ) ,
1067+ [ TEXT ( 'image' ) ]
1068+ ) ,
1069+ TEXT ( '.' )
1070+ ] ;
1071+ assert . deepStrictEqual ( mfm . parse ( input ) , output ) ;
1072+ } ) ;
1073+
1074+ it ( 'with angle brackets silent url' , ( ) => {
1075+ const input = '?[image](<https://raw.githubusercontent.com/syuilo/ai/master/ai.svg>).' ;
1076+ const output = [
1077+ LINK (
1078+ 'silent' ,
1079+ N_URL ( 'https://raw.githubusercontent.com/syuilo/ai/master/ai.svg' , true ) ,
1080+ [ TEXT ( 'image' ) ]
1081+ ) ,
1082+ TEXT ( '.' )
1083+ ] ;
1084+ assert . deepStrictEqual ( mfm . parse ( input ) , output ) ;
1085+ } ) ;
1086+
1087+ it ( 'with angle brackets embed url' , ( ) => {
1088+ const input = '.' ;
1089+ const output = [
1090+ LINK (
1091+ 'embed' ,
1092+ N_URL ( 'https://raw.githubusercontent.com/syuilo/ai/master/ai.svg' , true ) ,
1093+ [ TEXT ( 'image' ) ]
1094+ ) ,
1095+ TEXT ( '.' )
1096+ ] ;
1097+ assert . deepStrictEqual ( mfm . parse ( input ) , output ) ;
1098+ } ) ;
1099+
10611100 describe ( 'cannot nest a url in a link label' , ( ) => {
10621101 it ( 'basic' , ( ) => {
10631102 const input = 'official instance: [https://misskey.io/@ai](https://misskey.io/@ai).' ;
10641103 const output = [
10651104 TEXT ( 'official instance: ' ) ,
10661105 LINK (
1067- false ,
1106+ 'plain' ,
10681107 N_URL ( 'https://misskey.io/@ai' ) ,
10691108 [ TEXT ( 'https://misskey.io/@ai' ) ]
10701109 ) ,
@@ -1077,7 +1116,7 @@ hoge`;
10771116 const output = [
10781117 TEXT ( 'official instance: ' ) ,
10791118 LINK (
1080- false ,
1119+ 'plain' ,
10811120 N_URL ( 'https://misskey.io/@ai' ) ,
10821121 [
10831122 TEXT ( 'https://misskey.io/@ai' ) ,
@@ -1098,7 +1137,7 @@ hoge`;
10981137 const output = [
10991138 TEXT ( 'official instance: ' ) ,
11001139 LINK (
1101- false ,
1140+ 'plain' ,
11021141 N_URL ( 'https://misskey.io/@ai' ) ,
11031142 [ TEXT ( '[https://misskey.io/@ai' ) ]
11041143 ) ,
@@ -1113,7 +1152,7 @@ hoge`;
11131152 const output = [
11141153 TEXT ( 'official instance: ' ) ,
11151154 LINK (
1116- false ,
1155+ 'plain' ,
11171156 N_URL ( 'https://misskey.io/@ai' ) ,
11181157 [
11191158 BOLD ( [
@@ -1131,7 +1170,7 @@ hoge`;
11311170 const input = '[@example](https://example.com)' ;
11321171 const output = [
11331172 LINK (
1134- false ,
1173+ 'plain' ,
11351174 N_URL ( 'https://example.com' ) ,
11361175 [ TEXT ( '@example' ) ]
11371176 ) ,
@@ -1142,7 +1181,7 @@ hoge`;
11421181 const input = '[@example**@example**](https://example.com)' ;
11431182 const output = [
11441183 LINK (
1145- false ,
1184+ 'plain' ,
11461185 N_URL ( 'https://example.com' ) ,
11471186 [
11481187 TEXT ( '@example' ) ,
@@ -1160,7 +1199,7 @@ hoge`;
11601199 const input = '[foo](https://example.com/foo(bar))' ;
11611200 const output = [
11621201 LINK (
1163- false ,
1202+ 'plain' ,
11641203 N_URL ( 'https://example.com/foo(bar)' ) ,
11651204 [ TEXT ( 'foo' ) ]
11661205 ) ,
@@ -1173,7 +1212,7 @@ hoge`;
11731212 const output = [
11741213 TEXT ( '(' ) ,
11751214 LINK (
1176- false ,
1215+ 'plain' ,
11771216 N_URL ( 'https://example.com/foo(bar)' ) ,
11781217 [ TEXT ( 'foo' ) ]
11791218 ) ,
@@ -1187,7 +1226,7 @@ hoge`;
11871226 const output = [
11881227 TEXT ( '[test] foo ' ) ,
11891228 LINK (
1190- false ,
1229+ 'plain' ,
11911230 N_URL ( 'https://example.com' ) ,
11921231 [ TEXT ( 'bar' ) ]
11931232 ) ,
0 commit comments