Hi Wolfgang

oh yes, I understand better now that your issue is with the HTML being included 
in the tag attributes. Nothing to do with endtags.
Are you sure you proc is correct? Maybe try something like this:

proc ::dummy_tag_proc {params} {
  set title [ns_set get $params title]
  return "My title is $title"
}

Brian
________________________________
From: Wolfgang Winkler via naviserver-devel 
<naviserver-devel@lists.sourceforge.net>
Sent: Wednesday 4 January 2023 3:20 pm
To: Navidevel <naviserver-devel@lists.sourceforge.net>
Cc: Wolfgang Winkler <wolfgang.wink...@digital-concepts.com>
Subject: Re: [naviserver-devel] ns_adp_registerproc and attributes


Hi Brian!


With the closing tag, it's possible to create custom tags like:


<dummy_tag title="<h1>My Title</h1>">

  <p>Output this text</p>

</dummy_tag>


and proc ::dummy_tag_proc {params inner_html} {

...

}


The inner_html parameter works fine, but the attribute values will be truncated 
as well, if a ">" sign is encountered.


Regards,


Wolfgang



Am 04.01.23 um 15:57 schrieb Brian Fenton:
Hi Wolfgang

I think that you need to use the endtag optional parameter to 
ns_adp_registerscript i.e. see 
https://naviserver.sourceforge.io/n/naviserver/files/ns_adp_register.html

Brian
________________________________
From: Wolfgang Winkler via naviserver-devel 
<naviserver-devel@lists.sourceforge.net><mailto:naviserver-devel@lists.sourceforge.net>
Sent: Wednesday 4 January 2023 2:19 pm
To: Navidevel 
<naviserver-devel@lists.sourceforge.net><mailto:naviserver-devel@lists.sourceforge.net>
Cc: Wolfgang Winkler 
<wolfgang.wink...@digital-concepts.com><mailto:wolfgang.wink...@digital-concepts.com>
Subject: [naviserver-devel] ns_adp_registerproc and attributes


Hello!

When we try to use custom tags with attributes, we encounter a problem when 
passing html strings, e.g:

proc ::dummy_tag_proc {params} {
  return [ns_set array $params]
}
ns_adp_registerscript dummy_tag ::dummy_tag_proc

<dummy_tag title="<i class='fal fa-link'></i>">

Outputs:

title {"<i class='fal fa-icon'>}

Everything after the first ">" is truncated. Is there a safe way to prevent 
this behaviour?

Regards,

Wolfgang

--

Wolfgang Winkler
Geschäftsführung
wolfgang.wink...@digital-concepts.com<mailto:wolfgang.wink...@digital-concepts.com>
mobil +43.699.19971172

dc:büro
digital concepts Novak Winkler OG
Software & Design
Landstraße 68, 5. Stock, 4020 Linz
www.digital-concepts.com<http://www.digital-concepts.com>
tel +43.732.997117.72
tel +43.699.1997117.2

Firmenbuchnummer: 192003h
Firmenbuchgericht: Landesgericht Linz

[https://www.digital-concepts.com/cu/digitalconcepts2016/images/logo_digitalconcepts2016.png]

--

Wolfgang Winkler
Geschäftsführung
wolfgang.wink...@digital-concepts.com<mailto:wolfgang.wink...@digital-concepts.com>
mobil +43.699.19971172

dc:büro
digital concepts Novak Winkler OG
Software & Design
Landstraße 68, 5. Stock, 4020 Linz
www.digital-concepts.com<http://www.digital-concepts.com>
tel +43.732.997117.72
tel +43.699.1997117.2

Firmenbuchnummer: 192003h
Firmenbuchgericht: Landesgericht Linz

[https://www.digital-concepts.com/cu/digitalconcepts2016/images/logo_digitalconcepts2016.png]
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to