-
-
Notifications
You must be signed in to change notification settings - Fork 382
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Emoji img attributes configurable
1. User can specify a hash `context[:img_attrs]` to change the `img` tag attributes, e.g. `{ "draggable" => false }` 2. The hash key can be either `String` / `Symbol` (indifferent access) `{ "draggable" => false }` / `{ draggable: false }` => `<img draggable="false">` 3. The hash value can be either anything / proc-like object Proc-like object with default argument `name`: Given name is `:shipit:` `{ title: ->(name) { |n| n.gsub(":", "") } }` => `<img title="shipit">` So you can do any customisations with the attribute. 4. The hash value nil means clear the attribute of img tag For example, to clear the default `height`, `width`, and `align` attributes, pass `{ height: nil, width: nil, align: nil }` to `context[:img_attrs]`. 5. Refine tests with consistent styles
- Loading branch information
1 parent
f612486
commit 3518bbb
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3518bbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request was: #258.