@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Allow users to provide alt text for image embeds

Summary:
Ref T4843.

- Add an `alt` attribute so users can provide alternate text for `{Fnnn}`.
- Add an `alt` attribute to image macros.

Test Plan: Embedded an image with `alt` and a macro, inspected HTML source to verify the `alt` attribute was present.

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T4843

Differential Revision: https://secure.phabricator.com/D8925

+14 -1
+5
src/applications/files/remarkup/PhabricatorRemarkupRuleEmbedFile.php
··· 55 55 'float' => false, 56 56 'width' => null, 57 57 'height' => null, 58 + 'alt' => null, 58 59 ); 59 60 60 61 if ($option_string) { ··· 110 111 $image_class = 'phabricator-remarkup-embed-image'; 111 112 break; 112 113 } 114 + } 115 + 116 + if (isset($options['alt'])) { 117 + $attrs['alt'] = $options['alt']; 113 118 } 114 119 115 120 $img = phutil_tag('img', $attrs);
+7
src/applications/macro/remarkup/PhabricatorRemarkupRuleMeme.php
··· 36 36 $options['src'].' <'.PhabricatorEnv::getProductionURI($uri).'>'. 37 37 ($options['below'] != '' ? "\n\"{$options['below']}\"" : ''); 38 38 } else { 39 + $alt_text = pht( 40 + 'Macro %s: %s %s', 41 + $options['src'], 42 + $options['above'], 43 + $options['below']); 44 + 39 45 $img = phutil_tag( 40 46 'img', 41 47 array( 42 48 'src' => (string)$uri, 49 + 'alt' => $alt_text, 43 50 )); 44 51 } 45 52
+2 -1
src/docs/user/userguide/remarkup.diviner
··· 347 347 348 348 You can set file display options like this: 349 349 350 - {F123, layout=left, float, size=full} 350 + {F123, layout=left, float, size=full, alt="a duckling"} 351 351 352 352 Valid options are: 353 353 ··· 360 360 text 361 361 - **width** Scale image to a specific width. 362 362 - **height** Scale image to a specific height. 363 + - **alt** Provide alternate text for assistive technologies. 363 364 364 365 == Embedding Countdowns 365 366