diff --git a/src/applications/files/remarkup/PhabricatorRemarkupRuleEmbedFile.php b/src/applications/files/remarkup/PhabricatorRemarkupRuleEmbedFile.php index c631d53fd4..af7d910df0 100644 --- a/src/applications/files/remarkup/PhabricatorRemarkupRuleEmbedFile.php +++ b/src/applications/files/remarkup/PhabricatorRemarkupRuleEmbedFile.php @@ -55,6 +55,7 @@ final class PhabricatorRemarkupRuleEmbedFile 'float' => false, 'width' => null, 'height' => null, + 'alt' => null, ); if ($option_string) { @@ -112,6 +113,10 @@ final class PhabricatorRemarkupRuleEmbedFile } } + if (isset($options['alt'])) { + $attrs['alt'] = $options['alt']; + } + $img = phutil_tag('img', $attrs); $embed = javelin_tag( diff --git a/src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php b/src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php index 637d25ffa7..88c754ff37 100644 --- a/src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php +++ b/src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php @@ -36,10 +36,17 @@ final class PhabricatorRemarkupRuleMeme $options['src'].' <'.PhabricatorEnv::getProductionURI($uri).'>'. ($options['below'] != '' ? "\n\"{$options['below']}\"" : ''); } else { + $alt_text = pht( + 'Macro %s: %s %s', + $options['src'], + $options['above'], + $options['below']); + $img = phutil_tag( 'img', array( 'src' => (string)$uri, + 'alt' => $alt_text, )); } diff --git a/src/docs/user/userguide/remarkup.diviner b/src/docs/user/userguide/remarkup.diviner index b15dcc0e35..ab671649e1 100644 --- a/src/docs/user/userguide/remarkup.diviner +++ b/src/docs/user/userguide/remarkup.diviner @@ -347,7 +347,7 @@ from clipboard into the text area. You can set file display options like this: - {F123, layout=left, float, size=full} + {F123, layout=left, float, size=full, alt="a duckling"} Valid options are: @@ -360,6 +360,7 @@ Valid options are: text - **width** Scale image to a specific width. - **height** Scale image to a specific height. + - **alt** Provide alternate text for assistive technologies. == Embedding Countdowns