Editorial Workflows

Arrange Paragraphs

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: Arrange markdown paragraphs.

Shared by: geniuscqy

Comments: Comment Feed (RSS)

There are no comments yet.

+ Add Comment

Workflow Preview
Document Text ?
Folded Text
  • Include
  • Replace with:
If… ?
Run the block if
Input
  • is Equal to
  • is Not Equal to
  • Contains
  • Doesn't Contain
  • Matches Regular Expression
Stop ?
Stop
  • This Workflow
  • Repeat Block
Show HUD Alert
OFF
Message
Stopped
…End If
Run Python Script ?
Source Code
#coding: utf-8
import workflow
import dialogs
import re

action_in = workflow.get_input()

seq = re.split('\n(?=#+ )',action_in)
new_seq = dialogs.edit_list_dialog(title='Paragraphs',items=seq)
try:
	action_out = '\n'.join(new_seq)
	workflow.set_output(action_out)
except:
	workflow.stop()
Set Variable ?
Variable Name
Content
Value
Input
Extend Selection ?
Direction
  • Backward
  • Forward
  • Both
Unit
  • Start/End of Document
  • Start/End of Line
  • Number of Characters...
1
Replace Selected Text ?
Replacement Text
%cursorContent