Link to home
Start Free TrialLog in
Avatar of gboyleuk
gboyleukFlag for Bahrain

asked on

Google Script reject to insert Google link as link @ google docs

Can you please give me a solution or other way to deal with to make a google doc link work on the alert message or through sidebar in HTML link, I get Malformed HTML conten Error and if I replace my a regular link which such as www.google.com it works fine.

Here the error message looks like entering image description here

That full details :

ç: hi byehttps://docs.google.com/open?id=185g8pZGceMlIqmhEsYV8tkfxKsiRd_P3t3mhjzLiX0Y target=_blank > test
http://www.google.com>.
My code is the following :
COPYfunction test0001()
{

  var doc = DocumentApp.getActiveDocument(); 
  var docurl = doc.getUrl(); 

  //var x = Gconvertlinko() ;
  var ui = HtmlService.createHtmlOutput('hi '+ 'bye' + "<a href="+ docurl+"  target=_blank > test </a>"+ "<br/> <input type="+' text'+" name="+ 'lname'+ "  value="+ "http://www.google.com" +">")
  /*.setContent( DocumentApp.getActiveDocument.getUrl() + "<br/>"+ DocumentApp.getActiveDocument.getUrl() ) */
      .setTitle('Google Convertor');

  DocumentApp.getUi().showSidebar(ui);


}

Open in new window


Please let me know if you got any idea or thought to deal with that.
Screen-Shot-2018-12-10-at-1.25.14-PM.png
ASKER CERTIFIED SOLUTION
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gboyleuk

ASKER

Yeap that what was missing, thank you for spotting that.