Closed GAsplund closed 2 weeks ago
Hi @GAsplund , Sorry for the long delay, unfortunately I’ve not had enough free time to work on this side project.
Tags that this library does not know how to process seem to be turned into empty objects. For example,
<br/>
,<b>Test</b>
,<test></test>
, or justTest
generates the following:
Regarding the illegal tags being turned into empty objects, I will soon update the version so that the empty objects are not added, to avoid the Slack API bugs at the base, which seems to me to be a critical issue.
For example, parsing
<p><p>Inside</p><b>Outside</b></p>
produces:
Regarding nested paragraphs, I solved the problem and also added a wrap around content that would be legal in a paragraph. For example, if you were to pass the string <b>Test</b>
directly, it would be wrapped in <p><b>Test</b></p>
so that the content is not lost.
Side note: using only illegal tags in a
<p>
-tag generates a section with no elements in it, but using a fully empty<p>
-tag will produce an empty array, which might be inconsistent behavior.
Finally, regarding the inconsistency, I agree that it should be improved: since it doesn’t cause serious bugs anyway (at least not that I know of), I would include it in the list of improvements to be made. Unfortunately, I can’t give you a timeline for when these changes will be implemented, since I can only work on it in my spare time.
Thanks again for your feedback and suggestions!
Hi @GAsplund , Version 0.3.5 is now live. Please let me know if this fixes the problem for you, so I can close this issue!
Hello @matteodf, Everything seems to be working fine. Thanks a lot! I think this issue can be closed.
I found this issue when creating test strings for #4, and the issue is described briefly there, but I will describe the issue more here:
Tags that this library does not know how to process seem to be turned into empty objects. For example,
<br/>
,<b>Test</b>
,<test></test>
, or justTest
generates the following:As soon as these are wrapped in a
<p>
-tag, they are parsed into legal Slack objects, except for when they are nested, which can produce the same behavior. For example, parsing<p><p>Inside</p><b>Outside</b></p>
produces:but is resolved as soon as the inner
<p>
-tag is flattened into the outer.Side note: using only illegal tags in a
<p>
-tag generates a section with no elements in it, but using a fully empty<p>
-tag will produce an empty array, which might be inconsistent behavior.