Closed 0x213F closed 3 years ago
So I thought about this and realized it is not trivial to add "link."
1: On the backend, it will require enforcing non-overlapping intervals for 2 links. For example, if text from 0 - 10
goes to LINK A
, then text from 4 - 14
cannot link to LINK B
.
2: The front-end will require another dialog that allows the user to attach a link.
So, instead I changed the ticket to "underline," with the option to consider "upside down" and any other styles that you may see fit.
@fpjhannan if I recall correctly, you completed this ticket but I committed and authored the code. I still owe you proper attribution. If you have any desired immediate course of action, let me know what you have in mind. Otherwise I keep putting this on the back-burner (I will come back to it eventually!)
In the meantime, I am going to close this ticket since it is complete.
Summary
The feed allows for a user to create text comments. If the user selects the text inside of a text comment, they made create a text comment modification. A text comment modification, as of right now, allows a user to modify a sub-string of the main comment text by adding one of the following styles:
This ticket adds the backend functionality which adds a new type:
Implementation
Here is a non-exhaustive (might be exhaustive, I'm not certain though) of things that need to be done:
url = UrlField(blank=True, null=True)
. AddSTYLE_UNDERLINE
.~None
should be the value for every existing entry.~create_modification
interface. It will need to take one extra parameter:url
. Then make sure to use that new variable to save the value in the DB.~url
. Then, pass that tocreate_modification
.serialize
method. You'll notice thatserialize
is called inside the API endpoint in the context of serving the client an API response. By updating theserialize
method, you're updating the API response the client will receive.~create_modification
is called (especially in tests!) will need to be updated to includeurl=None
.~STYLE_URL
and passes aurl
parameter in the API endpoint.~Rendering
Before:
After (should say "underline" instead of "link"):
Bonus
While you are here, are there any other text comment modifications that you want to add? I kinda wanted to add upside down, what do you think? 🙃