Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14352827
D8925.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8925.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 20, 2:53 PM (20 h, 28 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6908116
Default Alt Text
D8925.diff (1 KB)
Attached To
Mode
D8925: Allow users to provide alt text for image embeds
Attached
Detach File
Event Timeline
Log In to Comment