* De-duplicate giphy_img? function in favor of a tested service.
Add a tested `GiphyService` and move `giphy_img?` function to it.
Make `labor/markdown_parser.rb` and `models/html_variant.rb` use the service version of the function.
* Refactor GiphyService into Giphy::Image class
Based on comments from @rhymes, I've changed this into a `Giphy::Image` class sincethe repo is currently being moved away from `XYZService` objects for namespacing and organization purposes.
* Fix typo
Update describe case to mention the current method name.
* Clarify uncommunicative variables in labor classes
Single letter variable names are largely a question of preference, in
some cases I think that convention mitigates the opaque nature of single
letter variable names (e.g., e for error, i for index, etc).
However, in some cases they can be unclear and there isn't much reason
to use single letter variables unless for some reason character length is
really important.
In this case, I would prefer clarity in variable names over brevity of
code so I've used Reek to identify short variable names and I'm changing
them.
It's pretty boring, but hopefully incremental code love changes like
this one add up and improve readability and accessibility for those
interested in reading this codebase.
* Remove commented code from 2 years ago
* Clarify uncommunicative naming in services classes
There is some context for this change in 6b81880f
* Clarify uncommunicative naming in models
There is some context for this change in 6b81880f
* Clarify uncommunicative naming in liquid_tags
There is some context for this change in 6b81880f
* Add ability to embed Medium URL as liquid tag
- Added new liquid tag - "{% medium https://medium.com}"
- Added a scraper - `MediumArticleRetrievalService` which crawls the
given Medium URL for informations needed for the liquid tag
* Add Medium logo in rendered liquid tag
* Added <kbd> tag support to markdown editors in article posts and comments.
* Fixed typo in test.
* Fixed test - now compares against inner html.
* Removed .showpage-signi-cta as dead code was reinstated accidentally via git merge.
* Use sass placeholder as no need to output the .kbd class in the css.
* Reinstated original css as accidentally changed with merge.
- Adds the ability to add emojis using colons 😂🎉
- The emoji conversion is added to the markdown parser labor
- When no emoji is found with the alias, same text is returned
- No assets added (no emoji images), so this will only be supported when the browser supports emojis (https://blog.getemoji.com/post/57054354336/which-browsers-support-emoji)
- Emoji conversion logic is out of markdown parser labor
- Adds its own spec
* remove inline markdown rule
* broaden evaluate_inline_markdown
basically same as evaluate_markdown but without class attributes
* remove inline markdown parser
* change code block color and background
* even out code padding top/bottom
* Really simple calculate reading time function
* Move parse_it so that the number of methods in MarkdownParser is at 20
* Added test and default value for reading time
* Initial automatic cleanup with rubocop
* Fix syntax error introduced by rubocop
* Cleanup seeds file
* Cleanup lib folder
* Exclude bin folder because it contains auto generated files
* Make Rubocop a little bit more chatty
* Block length should not include comments in the count
* Cleanup config folder
* Cleanup specs
* Updated Rubocop version and generated a todo file
* Fix broken ArticlesApi spec
* Fix tests
* Restored rubocop pre-commit hook
* open links in chats in new tabs
* fixed target_blank vulnerability
* add test to make sur links are being generated with target _blank
* add test for target blank vulnerability
* add rel and target to the whitelisted attributes
* add the link attributes to HTMLRouge#link