Jump to content

Siri shortcuts/workflow: Problem with relative links in richt text in "Create New Note" - mitigation with <base> tag


X-man

Recommended Posts

I am adding a "Safari web page" or a rich text (converted from html) to Evernote by means of the Action "Create New Note" or "Append to Note" from the shortcuts app.

For all local hyperlinks the href attribute gets completly wiped. The <a> tags themselves are being maintained (at least returned to shortcuts) by Evernote.

In the final Evernote note the links are not availale/visible at all. 

While this makes somewhat sense as relative links require a base url,

Evernote could evaluate the "safari web page" structure which contains the following details as available in shortcuts app: 

  • Page Contents 
  • Page Selection
  • Page URL
  • Name

 

 

The missing functionality can be mitigated by

  1. Extracting the page contents or selection from the safari web page,
  2. Converting the content to html by means of the "Make HTMK from Rich Text" action with the "Make Full Document" switch enabled and
  3. Adding a <base> tag with the "Page URL" as the value for the href argument. the Page URL can be extracted by the "Get Details of Safari Web Page" of the shortcuts app. 
    To add the <base> Tag I use the "Replace Text" action to search for the <head> tag (ideally with "Regular Expression" enabled) to cover for optional parameters in the head tag.

 

This way selections and full pages (as rich text) can be added to Evernote, e.g. when collecting research. 

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...