diff options
| author | RblSb <msrblsb@gmail.com> | 2020-03-22 23:05:43 +0300 |
|---|---|---|
| committer | RblSb <msrblsb@gmail.com> | 2020-03-22 23:05:43 +0300 |
| commit | 498b6ca644fcf666a49097fb197e72800769e03a (patch) | |
| tree | e9319d57631348ad1296baf91fc7ad758e5cacc2 /default-config.json | |
| parent | 1438ac5272a3919a342feee526360b2d4b7438f5 (diff) | |
Fix chat links
Diffstat (limited to 'default-config.json')
| -rw-r--r-- | default-config.json | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/default-config.json b/default-config.json index 6d0a99e..ab6dd93 100644 --- a/default-config.json +++ b/default-config.json @@ -55,16 +55,16 @@ ], "filters": [ { - "name": "url", - "regex": "(https?:\\/\\/[^ \t]*)", + "name": "image", + "regex": "(https?:\\/\\/[^']*\\.)(png|jpg|gif|jpeg)([^' ,]*)", "flags": "g", - "replace": "<a href='$1' target='_blank' rel='noopener noreferrer'>$1</a>" + "replace": "<a href='$1$2$3' target='_blank' rel='noopener noreferrer'><img src='$1$2$3' style='max-width:200px; max-height:200px'/></a>" }, { - "name": "image", - "regex": "(https?:\\/\\/.*\\.)(png|jpg|gif|jpeg)([^ ,]*)", + "name": "url", + "regex": "(^|[^'])(https?:\\/\\/[^' \t]*)", "flags": "g", - "replace": "<a href='$1$2$3' target='_blank' rel='noopener noreferrer'><img src='$1$2$3' style='max-width:200px; max-height:200px'/></a>" + "replace": "$1<a href='$2' target='_blank' rel='noopener noreferrer'>$2</a>" } ] } |
