@@ -89,8 +89,8 @@ private static void Parse(StringReader reader, Configuration config)
8989 }
9090 else // Setting
9191 {
92- var setting =
93- ParseSetting ( Configuration . IgnoreInlineComments ? line : lineWithoutComment , lineNumber ) ;
92+ var setting = ParseSetting (
93+ Configuration . IgnoreInlineComments ? line : lineWithoutComment , reader , ref lineNumber ) ;
9494
9595 if ( ! Configuration . IgnoreInlineComments )
9696 {
@@ -183,7 +183,7 @@ private static Section ParseSection(string line, int lineNumber)
183183 : new Section ( sectionName ) ;
184184 }
185185
186- private static Setting ParseSetting ( string line , int lineNumber )
186+ private static Setting ParseSetting ( string line , StringReader reader , ref int lineNumber )
187187 {
188188 // Format(s) of a setting:
189189 // 1) <name> = <value>
@@ -239,6 +239,35 @@ private static Setting ParseSetting(string line, int lineNumber)
239239
240240 var settingValue = line . Substring ( equalSignIndex + 1 ) . Trim ( ) ;
241241
242+ // A setting value that only consists of a quote mark can indicate a multiline value.
243+ // Read it until we encounter a line that consists of a single quote mark.
244+ if ( settingValue == "[[" )
245+ {
246+ var settingValueBuffer = new StringBuilder ( ) ;
247+ settingValueBuffer . Append ( "[[" ) ;
248+
249+ while ( ( line = reader . ReadLine ( ) ) != null )
250+ {
251+ ++ lineNumber ;
252+
253+ if ( line == "]]" )
254+ {
255+ break ;
256+ }
257+
258+ settingValueBuffer . AppendLine ( line ) ;
259+ }
260+
261+ if ( settingValueBuffer . Length > 0 && settingValueBuffer [ settingValueBuffer . Length - 1 ] == '\n ' )
262+ {
263+ settingValueBuffer . Remove ( settingValueBuffer . Length - 1 , 1 ) ;
264+ }
265+
266+ settingValueBuffer . Append ( "]]" ) ;
267+
268+ settingValue = settingValueBuffer . ToString ( ) ;
269+ }
270+
242271 return new Setting ( settingName , settingValue ) ;
243272 }
244273
0 commit comments