mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-08-07 09:58:34 +00:00
fix(matrix): preserve mxc markdown image sources
This commit is contained in:
parent
0b9ca744c2
commit
4137be62a1
@ -18,7 +18,7 @@ from nanobot.security.workspace_policy import is_path_within
|
|||||||
try:
|
try:
|
||||||
import aiohttp
|
import aiohttp
|
||||||
import nh3
|
import nh3
|
||||||
from mistune import create_markdown
|
from mistune import HTMLRenderer, create_markdown
|
||||||
from nio import (
|
from nio import (
|
||||||
AsyncClient,
|
AsyncClient,
|
||||||
AsyncClientConfig,
|
AsyncClientConfig,
|
||||||
@ -77,7 +77,7 @@ class _MediaTooLargeError(Exception):
|
|||||||
"""Raised when an inbound Matrix media download exceeds the configured cap."""
|
"""Raised when an inbound Matrix media download exceeds the configured cap."""
|
||||||
|
|
||||||
MATRIX_MARKDOWN = create_markdown(
|
MATRIX_MARKDOWN = create_markdown(
|
||||||
escape=True,
|
renderer=HTMLRenderer(escape=True, allow_harmful_protocols=("mxc://",)),
|
||||||
plugins=["table", "strikethrough", "url", "superscript", "subscript"],
|
plugins=["table", "strikethrough", "url", "superscript", "subscript"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user