Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Add and update HTML transformers [TS-311] #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jaredplanter
Copy link

Description

These changes are a part of TS-311 and get us most of the way there with the exception of this bug which will be addressed with this ticket. Once that is resolved and we are satisfied we can make this a pull request against the official repository for slack_transformer.

Until then we will be pointing to this branch in our fork for the implementation.

Checklist

  • Add hyperlink transformer to convert HTML hyperlinks to Mrkdwn links

  • Add line break transformer to convert HTML line breaks to negative space until we can get \n to work

  • Add unsupported transformer to remove remaining html tags, excluding Slack's link tags

  • Update the bold transformer to include the semantic <strong> tag

  • Update the italics transformer to include the semantic <em> tag

  • Update specs

@jaredplanter jaredplanter self-assigned this Aug 11, 2021
@jaredplanter jaredplanter changed the title Add and update HTML transformers Add and update HTML transformers [TS-311] Aug 11, 2021

def to_slack
# Filter out all remaining < > tags except for Slack links (<http://url|text> or <http://url>)
input.gsub(/<(.[^http][^|]*?)>/, '')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote this transformer to clean up remaining HTML tags for now with the plan of replacing it with some sort of "cleaner" class that does this and eliminates the spacing bug. As mentioned here.

* Add hyperlink transformer to convert HTML hyperlinks to Mrkdwn links

* Add line break transformer to convert HTML line breaks to new lines (\n)

* Add unsupported transformer to remove remaining html tags, excluding Slack's link tags

* Update the bold transformer to include the semantic <strong> tag

* Update the italics transformer to include the semantic <em> tag

* Update specs
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants