File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -59,9 +59,14 @@ export default {
5959 } ,
6060 convertCommentsToJson ( raw ) {
6161 return [
62- ...raw . matchAll ( / # < C o m m e n t ( .* ?) > / g) ,
62+ ...raw . matchAll ( / # < C o m m e n t ( .* ?) ( v a l u e : " [ ^ " ] * " ) ( . * ? ) > / g) ,
6363 ] . map ( ( match ) => {
64- const fields = match [ 1 ]
64+ const valueField = match [ 0 ] . match ( / (?< = , ) v a l u e : " ( [ ^ " ] | \\ " ) * [ ^ \\ ] " , / ) ?. [ 0 ] ;
65+ const baseMatch = match [ 0 ] . replace ( / ^ # < C o m m e n t / , "" ) ;
66+ const baseMatchWithoutValue = valueField
67+ ? baseMatch . split ( valueField ) . join ( "" )
68+ : baseMatch ;
69+ const fields = baseMatchWithoutValue
6570 . split ( "," )
6671 . map ( ( part ) => part . trim ( ) )
6772 . map ( ( pair ) => {
@@ -81,7 +86,15 @@ export default {
8186 cleaned ,
8287 ] ;
8388 } ) ;
84- return Object . fromEntries ( fields ) ;
89+ return Object . fromEntries ( valueField
90+ ? [
91+ ...fields ,
92+ [
93+ "value" ,
94+ valueField ?. replace ( / ^ v a l u e : ? / , "" ) ,
95+ ] ,
96+ ]
97+ : fields ) ;
8598 } ) ;
8699 } ,
87100 isRelevant ( payload ) {
You can’t perform that action at this time.
0 commit comments