Posted to tcl by schelte at Wed May 10 10:37:26 GMT 2023view raw

  1. tkchat::Hook add join [list apply [list args {
  2. rename sgml::PCDATA {}
  3. rename sgml::PCDATA_NEW sgml::PCDATA
  4. }]]
  5.  
  6. namespace eval sgml {}
  7. proc sgml::PCDATA_NEW {opts pcdata} {
  8. array set options $opts
  9.  
  10. if {$options(-ignorewhitespace) && \
  11. ![string length [string trim $pcdata]]} {
  12. return {}
  13. }
  14.  
  15. if {0 && ![regexp ^[cl $::sgml::Char]*\$ $pcdata]} {
  16. upvar #0 $options(-statevariable) state
  17. uplevel #0 $options(-errorcommand) [list illegalcharacters "illegal, non-Unicode characters found in text \"$pcdata\" around line $state(line)"]
  18. }
  19.  
  20. uplevel #0 $options(-characterdatacommand) [list $pcdata]
  21. }
  22.