Code Duplication    Length = 17-19 lines in 2 locations

lib/markdown/markdown.php 2 locations

@@ 792-810 (lines=19) @@
789
		}
790
		return $result;
791
	}
792
	function _doAnchors_inline_callback($matches) {
793
		$whole_match	=  $matches[1];
794
		$link_text		=  $this->runSpanGamut($matches[2]);
795
		$url			=  $matches[3] == '' ? $matches[4] : $matches[3];
796
		$title			=& $matches[7];
797
798
		$url = $this->encodeAttribute($url);
799
800
		$result = "<a href=\"$url\"";
801
		if (isset($title)) {
802
			$title = $this->encodeAttribute($title);
803
			$result .=  " title=\"$title\"";
804
		}
805
806
		$link_text = $this->runSpanGamut($link_text);
807
		$result .= ">$link_text</a>";
808
809
		return $this->hashPart($result);
810
	}
811
812
813
	function doImages($text) {
@@ 896-912 (lines=17) @@
893
894
		return $result;
895
	}
896
	function _doImages_inline_callback($matches) {
897
		$whole_match	= $matches[1];
898
		$alt_text		= $matches[2];
899
		$url			= $matches[3] == '' ? $matches[4] : $matches[3];
900
		$title			=& $matches[7];
901
902
		$alt_text = $this->encodeAttribute($alt_text);
903
		$url = $this->encodeAttribute($url);
904
		$result = "<img src=\"$url\" alt=\"$alt_text\"";
905
		if (isset($title)) {
906
			$title = $this->encodeAttribute($title);
907
			$result .=  " title=\"$title\""; # $title already quoted
908
		}
909
		$result .= $this->empty_element_suffix;
910
911
		return $this->hashPart($result);
912
	}
913
914
915
	function doHeaders($text) {