Code Duplication    Length = 17-19 lines in 2 locations

components/Markdown.php 2 locations

@@ 927-945 (lines=19) @@
924
		 *
925
		 * @return string
926
		 */
927
		public function _doAnchors_inline_callback( $matches ) {
928
929
			$whole_match = $matches[1];
930
			$link_text   = $this->runSpanGamut( $matches[2] );
931
			$url         = $matches[3] == '' ? $matches[4] : $matches[3];
932
			$title       =& $matches[7];
933
934
			$url = $this->encodeAttribute( $url );
935
936
			$result = "<a href=\"$url\"";
937
			if ( isset( $title ) ) {
938
				$title   = $this->encodeAttribute( $title );
939
				$result .= " title=\"$title\"";
940
			}
941
942
			$link_text = $this->runSpanGamut( $link_text );
943
			$result   .= ">$link_text</a>";
944
945
			return $this->hashPart( $result );
946
		}
947
948
		/**
@@ 1052-1068 (lines=17) @@
1049
		 *
1050
		 * @return string
1051
		 */
1052
		public function _doImages_inline_callback( $matches ) {
1053
1054
			$whole_match = $matches[1];
1055
			$alt_text    = $matches[2];
1056
			$url         = $matches[3] == '' ? $matches[4] : $matches[3];
1057
			$title       =& $matches[7];
1058
1059
			$alt_text = $this->encodeAttribute( $alt_text );
1060
			$url      = $this->encodeAttribute( $url );
1061
			$result   = "<img src=\"$url\" alt=\"$alt_text\"";
1062
			if ( isset( $title ) ) {
1063
				$title   = $this->encodeAttribute( $title );
1064
				$result .= " title=\"$title\"";
1065
				// $title already quoted
1066
			}
1067
			$result .= $this->empty_element_suffix;
1068
1069
			return $this->hashPart( $result );
1070
		}
1071