diff --git a/docs/plugins.rst b/docs/plugins.rst index add20669..f69fed95 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -297,6 +297,8 @@ If the value matches that pattern, the plugin returns an HTML link element: @hookimpl def render_cell(value): # Render {"href": "...", "label": "..."} as link + if not isinstance(value, str): + return None stripped = value.strip() if not stripped.startswith("{") and stripped.endswith("}"): return None @@ -304,6 +306,8 @@ If the value matches that pattern, the plugin returns an HTML link element: data = json.loads(value) except ValueError: return None + if not isinstance(data, dict): + return None if set(data.keys()) != {"href", "label"}: return None href = data["href"]