Editorial Workflows

HTML Encode

public workflow

Install Workflow...

This workflow contains at least one Python script. Only use it if you trust the person who shared this with you, and if you know exactly what it does.

I understand, install the workflow!

This is a workflow for Editorial, a Markdown and plain text editor for iOS. To download it, you need to view this page on a device that has the app installed.

Description: ::: Works on selected text

::: Converts unicode characters into HTML escaped characters

Shared by: http://www.macdrifter.com/2013/08/editorial-workflow-encode-unicode-to-html.html

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Selected Text ?
Entire Line(s)
OFF
Empty Selection Output
  • No Output
  • All Text
  • Closest Word
Folded Text
  • Include
  • Replace with:
Set Variable ?
Variable Name
origString
Value
Input
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import cgi



action_in = workflow.get_input()

tempString = workflow.get_variable('origString')

encodeString = cgi.escape(tempString).encode('ascii', 'xmlcharrefreplace')

#TODO: Generate the output...
action_out = encodeString

workflow.set_output(action_out)
Replace Selected Text ?
Replacement Text
Input