Code Duplication    Length = 3-4 lines in 2 locations

Parser.php 2 locations

@@ 336-338 (lines=3) @@
333
			$pos = strpos($text, $found);
334
335
			// add the text up to next marker to the paragraph
336
			if ($pos !== 0) {
337
				$paragraph[] = ['text', substr($text, 0, $pos)];
338
			}
339
			$text = $found;
340
341
			$parsed = false;
@@ 355-358 (lines=4) @@
352
					break;
353
				}
354
			}
355
			if (!$parsed) {
356
				$paragraph[] = ['text', substr($text, 0, 1)];
357
				$text = substr($text, 1);
358
			}
359
		}
360
361
		$paragraph[] = ['text', $text];