I'm having trouble to remove a link from a Text element.
Calling .setLinkUrl(null) on it seems to work, but makes the document crash! You can see it happening with this tiny google script:
function test() {
var body = DocumentApp.getActiveDocument().getBody();
var text = body.appendParagraph("link").editAsText();
text.setLinkUrl(null);
}
Running it then trying to edit the document gives me a "File unavailable" error. Also tried to set remove the link with .setAttributes, but same error.
Is there a way to remove a link or just generally reset the styles on a text element?
Thanks!