Files
markdown/source/parser/implementation/markdown-implementation-html.ads
Maxim Reznik 451ddcfb5b Add Link_Attributes extension
to allow attributes on links and images:

```
![image](foo.jpg){#id .class width=30 height=20px}
```

Move HTML attribute list type to a dedicated package.
Move common HTML attribute regexp patterns to a dedicated package.
Introduce Extension_Set type and `Set_Extensions` procedure.

See
https://garrettgman.github.io/rmarkdown/authoring_pandoc_markdown.html#links
2025-06-04 13:51:29 +03:00

29 lines
863 B
Ada

--
-- Copyright (C) 2021-2024, AdaCore
--
-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
--
-- Common regexp patterns for HTML elements and attributes.
package Markdown.Implementation.HTML is
pragma Preelaborate;
Attribute_Name : constant Wide_Wide_String := "[a-zA-Z_:][a-zA-Z0-9_.:\-]*";
Unquoted_Attribute_Value : constant Wide_Wide_String :=
"[^ \t\v\f""'=<>`]+";
Single_Quoted_Attribute_Value : constant Wide_Wide_String := "'[^']*'";
Double_Quoted_Attribute_Value : constant Wide_Wide_String := """[^""]*""";
Attribute_Value : constant Wide_Wide_String :=
Unquoted_Attribute_Value & "|" &
Single_Quoted_Attribute_Value & "|" &
Double_Quoted_Attribute_Value;
Attribute_Value_Spec : constant Wide_Wide_String :=
"[ \t]*=[ \t]*(?:" & Attribute_Value & ")";
end Markdown.Implementation.HTML;