I am attempting to store snippets of HTML in a Multi-Line text field. This field is a hidden field which I read and write to using REST in an app I am building that allows the user to manipulate a tree graph without having to open an html file just by dragging and dropping nodes. So far it's working great with one small oddity I can't seem to get around.
To me Plain Text means PLAIN text but if I were to add...
https://google.com
... to my Multi-Line text field, save it, and reopen the edit screen, I find that Sharepoint has converted it to an anchor tag and reads...
<a href="https://google.com">https://google.com</a>
I understand why they have this functionality if you're using the field in a standard out of the box way but it becomes particularly troublesome if I want to store an actual anchor tag as text to later be used in my graph because...
<li>
<a href="https://google.com">Click Here to get to Google!</a>
</li>
...becomes...
<li>
<a href="<a href="https://google.com">https://google.com</a>">Click Here to get to Google!</a>
</li>
... which makes no sense and breaks the link.
I have also noticed that adding a local link like...
https://mysharepointsite.com/path/to/location
... automatically gets "relativized" down to...
/path/to/location
... This is just so annoying as there are times I want to include these links in outlook email body's and obviously a relative link means nothing in an email body because it has lost the host info. But that is another issue all together.
So my question is. How do you tell SharePoint to quit messing with my text? In any other Database I can think of there are way's to escape or sanitize text... SharePoint has GOT to have something similar right? Please help.
It might be important to note that any text saved to this field will be added via javascript using REST api. The field will be completely hidden to any human for manual editing.