mirror of
https://github.com/AdaCore/markdown.git
synced 2026-02-12 13:11:15 -08:00
to allow attributes on links and images:
```
{#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
29 lines
863 B
Ada
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;
|