[pve-devel] [PATCH v3 common 1/1] REST handler: get property description: escape curly braces for asciidoc

Fabian Ebner f.ebner at proxmox.com
Thu Apr 7 12:05:38 CEST 2022


Text enclosed in unescaped curly braces will be interpreted as an
attribute reference breaking and e.g. lead to the description not
showing up at all a generated man page further down the line.

Signed-off-by: Fabian Ebner <f.ebner at proxmox.com>
---

New in v3.

Tried out various uses of curly braces and seems to work for man
pages, HTML doc and API-viewer.

 src/PVE/RESTHandler.pm | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/PVE/RESTHandler.pm b/src/PVE/RESTHandler.pm
index 4f1458b..c746181 100644
--- a/src/PVE/RESTHandler.pm
+++ b/src/PVE/RESTHandler.pm
@@ -517,6 +517,9 @@ my $get_property_description = sub {
 	chomp $wdescr;
 	$wdescr =~ s/^$/+/mg;
 
+	$wdescr =~ s/{/\\{/g;
+	$wdescr =~ s/}/\\}/g;
+
 	$res .= $wdescr . "\n";
 
 	if (my $req = $phash->{requires}) {
-- 
2.30.2






More information about the pve-devel mailing list