Page MenuHomePhabricator

D8925.diff
No OneTemporary

D8925.diff

diff --git a/src/applications/files/remarkup/PhabricatorRemarkupRuleEmbedFile.php b/src/applications/files/remarkup/PhabricatorRemarkupRuleEmbedFile.php
--- a/src/applications/files/remarkup/PhabricatorRemarkupRuleEmbedFile.php
+++ b/src/applications/files/remarkup/PhabricatorRemarkupRuleEmbedFile.php
@@ -55,6 +55,7 @@
'float' => false,
'width' => null,
'height' => null,
+ 'alt' => null,
);
if ($option_string) {
@@ -112,6 +113,10 @@
}
}
+ 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
--- a/src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php
+++ b/src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php
@@ -36,10 +36,17 @@
$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
--- a/src/docs/user/userguide/remarkup.diviner
+++ b/src/docs/user/userguide/remarkup.diviner
@@ -347,7 +347,7 @@
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 @@
text
- **width** Scale image to a specific width.
- **height** Scale image to a specific height.
+ - **alt** Provide alternate text for assistive technologies.
== Embedding Countdowns

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 3, 11:48 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6710523
Default Alt Text
D8925.diff (1 KB)

Event Timeline