Replace configurable characters for others, example normal quotation marks with typographical ones
{
"id": "io.infomaker.charactertransformation",
"name": "im-charactertransformation",
"url": "https://plugins.writer.infomaker.io/v1/infomaker/im-charactertransformation/{PLUGIN_VERSION}/index.js",
"enabled": true,
"mandatory": false,
"data": {
"rules": [
{
"char": "\"",
"to": ["“", "”"]
},
{
"char": "'",
"to": "’"
},
{
"char": "-",
"position": 0,
"to": "– "
}
]
}
}
Property | Type | Required | Description |
---|---|---|---|
rules |
Array | true |
contains a list of all the characters to replace |
char |
String | true |
The character to replace |
to |
String/Array | true |
What the character will be replaced with |
Position |
String | false |
Only affects characters at that point in the paragraph |
Rules describe what characters should be replaced with what characters.
The first example above will replace a straight double quote into either a left typographical quote or a right typographical quote depending on whether it is a closing or opening quote.
The second example will replace a straight single quote into a right single quote.
The third example will replace a minus with a longer dash if the minus is the first character in a paragraph.
None