Editorial Workflows

CM Accept all

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: Workflow to accept all Critic Markup in document.

Based on Macdrifter's [original workflow](http://www.editorial-workflows.com/workflow/6096637357195264/JyzjRq99yLM)

Shared by: mjakubowiak

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Document Text ?
Folded Text
  • Include
  • Replace with:
Repeat… ?
Repeat with
  • Every Line
  • Every Match of Regular Expression:
((?s)\{([\+\+|\-\-|\~\~|\=\=|\>\>])(.*?)([\+\+|\-\-|\~\~|\=\=|\<\<])[ \t]*(\[(.*?)\])?[ \t]*\})
Match Group
0 (entire match)
Reverse
OFF
Document Text ?
Folded Text
  • Include
  • Replace with:
Find ?
Search for
((?s)\{([\+\+|\-\-|\~\~|\=\=|\>\>])(.*?)([\+\+|\-\-|\~\~|\=\=|\<\<])[ \t]*(\[(.*?)\])?[ \t]*\})
Match Group (RegEx)
0 (entire match)
Search Type
  • Regular Expression
  • Case-insensitive Search (A = a)
  • Case-sensitive Search (A ≠ a)
Output
  • Found Text
  • Range of Text (from:to)
Select Range ?
Range (from:to)
Input
Relative to
  • Entire Document
  • Current Selection
Set Variable ?
Variable Name
matchPos
Value
Input
accept ?
Run the block if
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
If Deletions ?
Run the block if
Selected Text
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
((?s)\{([\-\-])(.*?)([\-\-])[ \t]*(\[(.*?)\])?[ \t]*\})
Replace Selected Text ?
Replacement Text
…End If
If Additions ?
Run the block if
Selected Text
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
\{(\+\+)(.*?)(\+\+)[ \t]*(\[(.*?)\])?[ \t]*\}
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import re
import editor

selection = editor.get_selected_text()

reg_pattern = r'(?s)\{(\+\+)(.*?)(\+\+)[ \t]*(\[(.*?)\])?[ \t]*\}'

reg_obj = re.compile(reg_pattern)

clean_string = re.sub(reg_obj, '\\2', selection)

action_in = workflow.get_input()

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

workflow.set_output(clean_string)
Replace Selected Text ?
Replacement Text
Input
…End If
If Replace ?
Run the block if
Selected Text
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
\{(\~\~)(.*?)(\~\~)[ \t]*(\[(.*?)\])?[ \t]*\}
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import re
import editor

selection = editor.get_selected_text()

reg_pattern = r'''(?s)\{\~\~(?P<original>(?:[^\~\>]|(?:\~(?!\>)))+)\~\>(?P<new>(?:[^\~\~]|(?:\~(?!\~\})))+)\~\~\}'''


reg_obj = re.compile(reg_pattern)

clean_string = re.sub(reg_obj, r'\g<new>', selection)

action_in = workflow.get_input()

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

workflow.set_output(clean_string)
Replace Selected Text ?
Replacement Text
Input
…End If
If Highlight ?
Run the block if
Selected Text
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
\{(\=\=)(.*?)(\=\=)[ \t]*(\[(.*?)\])?[ \t]*\}
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import re
import editor

selection = editor.get_selected_text()

reg_pattern = r'(?s)\{(\=\=)(.*?)(\=\=)[ \t]*(\[(.*?)\])?[ \t]*\}'

reg_obj = re.compile(reg_pattern)

clean_string = re.sub(reg_obj, '\\2', selection)

action_in = workflow.get_input()

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

workflow.set_output(clean_string)
Replace Selected Text ?
Replacement Text
Input
…End If
If Comment ?
Run the block if
Selected Text
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
\{(\>\>)(.*?)(\<\<)[ \t]*(\[(.*?)\])?[ \t]*\}
Replace Selected Text ?
Replacement Text
…End If
…End If
…End Repeat