public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stefan Sterz <s.sterz@proxmox.com>
To: Thomas Lamprecht <t.lamprecht@proxmox.com>,
	Proxmox VE development discussion <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH docs v2 2/2] asciidoc-pve: ignore anchor names in curly braces
Date: Mon, 14 Nov 2022 09:26:40 +0100	[thread overview]
Message-ID: <f316ee98-5711-b8db-3be4-52656a77dcba@proxmox.com> (raw)
In-Reply-To: <ba1d5571-e831-e252-f0a4-b5f91ee07327@proxmox.com>

On 11/11/22 19:22, Thomas Lamprecht wrote:
> Am 11/11/2022 um 16:05 schrieb Stefan Sterz:
>> previously the scanner would detect some `onlineHelp` keys that are
>> set via CBind as anchor names. this would cause it to fail, as they
>> cannot be present anywhere in the documentation. no valid anchor name
>> can be wrapped in curly braces, as they need to be valid xml names.
>> hence it should be safe to just ignore all keys wrapped in curly
>> braces.
>>
>> Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
>> ---
>>  asciidoc-pve.in | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/asciidoc-pve.in b/asciidoc-pve.in
>> index d638a38..c536371 100644
>> --- a/asciidoc-pve.in
>> +++ b/asciidoc-pve.in
>> @@ -465,7 +465,7 @@ sub scan_extjs_file {
>>      debug("scan-extjs $filename");
>>  
>>      while(defined(my $line = <$fh>)) {
>> -	if ($line =~ m/\s+onlineHelp:\s*[\'\"](.*?)[\'\"]/) {
>> +	if ($line =~ m/\s+onlineHelp:\s*[\'\"]([^{].*?[^}])[\'\"]/) {
> 
> IIUC this indirectly raised the minimum length of references to two characters,
> not a deal breaker IMO as I don't really expect two characters to be used anytime
> soon (maybe with unicode 🤔🧠💭 x)), but maybe hint it in the commit message.
> 

yes that is correct. just to have made the suggestion: the "[^}]" could
be dropped here. that should get us back down to one character, but will
also filter the necessary keys. and anchors like "{key" are just as
invalid as "{key}" in asciidoc.

>>  	    my $blockid = $1;
>>  	    my $link = $fileinfo->{blockid_target}->{default}->{$blockid};
>>  	    die "undefined blockid '$blockid' ($filename, line $.)\n"
> 




  reply	other threads:[~2022-11-14  8:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 15:05 [pve-devel] [PATCH docs v2 0/2] pve fix help buttons by accounting for keys in widget toolkit Stefan Sterz
2022-11-11 15:05 ` [pve-devel] [PATCH docs v2 1/2] pveum: add the "user_mgmt" reference to the documentation Stefan Sterz
2022-11-11 18:24   ` [pve-devel] applied: " Thomas Lamprecht
2022-11-11 15:05 ` [pve-devel] [PATCH docs v2 2/2] asciidoc-pve: ignore anchor names in curly braces Stefan Sterz
2022-11-11 18:22   ` Thomas Lamprecht
2022-11-14  8:26     ` Stefan Sterz [this message]
2022-11-14 10:07       ` Thomas Lamprecht
2022-11-14 10:13         ` Stefan Sterz
2022-11-14 10:16           ` Thomas Lamprecht
2022-11-11 15:05 ` [pve-devel] [PATCH manager v2 1/1] fix #4328: ui: add widget toolkit to dependencies of OnlineHelpInfo.js Stefan Sterz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f316ee98-5711-b8db-3be4-52656a77dcba@proxmox.com \
    --to=s.sterz@proxmox.com \
    --cc=pve-devel@lists.proxmox.com \
    --cc=t.lamprecht@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal