Index: trunk/extensions/Wikidata/OmegaWiki/Editor.php |
— | — | @@ -1104,13 +1104,21 @@ |
1105 | 1105 | } |
1106 | 1106 | |
1107 | 1107 | public function getViewHTML( IdStack $idPath, $value ) { |
| 1108 | + global $wgOut; |
1108 | 1109 | $definition = getDefinedMeaningDefinition( $value ); |
1109 | 1110 | $definedMeaningAsLink = definedMeaningAsLink( $value ); |
1110 | 1111 | $escapedDefinition = htmlspecialchars( $definition ); |
1111 | 1112 | |
1112 | 1113 | if ( $this->truncate && strlen( $definition ) > $this->truncateAt ) |
1113 | 1114 | $escapedDefinition = '<span title="' . $escapedDefinition . '">' . htmlspecialchars( mb_substr( $definition, 0, $this->truncateAt ) ) . wfMsg( 'ellipsis' ) . '</span>' . EOL; |
1114 | | - |
| 1115 | + |
| 1116 | + static $isMetaDescSet = 0 ; |
| 1117 | + if ( $isMetaDescSet == 0 ) { |
| 1118 | + $expression = definedMeaningExpression ( $value ) ; |
| 1119 | + $wgOut->addMeta( 'Description', $expression . ": " . $definition ); |
| 1120 | + $isMetaDescSet = 1 ; |
| 1121 | + } |
| 1122 | + |
1115 | 1123 | return $definedMeaningAsLink . ": " . $escapedDefinition; |
1116 | 1124 | } |
1117 | 1125 | |