@@ -232,7 +232,6 @@ function validateChannel(channel: ExtendedXmlNode, callbacks: ValidationCallback
232232 }
233233 callbacks . onPodcastIndexLiveItemsFound ( liveItems . length ) ;
234234
235-
236235 // PHASE 5
237236
238237 // podcast:block
@@ -251,6 +250,10 @@ function validateChannel(channel: ExtendedXmlNode, callbacks: ValidationCallback
251250 . checkValue ( isYesNo )
252251 . checkRemainingAttributes ( ) ;
253252
253+ // PHASE 6
254+
255+ // podcast:txt
256+ checkPodcastTxt ( 'channel' , channel , callbacks ) ;
254257
255258 // PROPOSALS
256259
@@ -371,6 +374,17 @@ function checkPodcastImages(level: Level, node: ExtendedXmlNode, callbacks: Vali
371374 . checkRemainingAttributes ( ) ;
372375}
373376
377+ function checkPodcastTxt ( level : Level , node : ExtendedXmlNode , callbacks : ValidationCallbacks ) {
378+ const txts = findChildElements ( node , ...Qnames . PodcastIndex . txt ) ;
379+ const txtReference = podcastIndexReference ( 'https://github.com/Podcastindex-org/podcast-namespace/blob/main/docs/1.0.md#txt' ) ;
380+ for ( const txt of txts ) {
381+ ElementValidation . forElement ( level , txt , callbacks , txtReference )
382+ . checkOptionalAttribute ( 'purpose' , isAtMostCharacters ( 128 ) )
383+ . checkValue ( isAtMostCharacters ( 4000 ) )
384+ . checkRemainingAttributes ( ) ;
385+ }
386+ }
387+
374388function checkPodcastTagUsage ( node : ExtendedXmlNode , callbacks : ValidationCallbacks ) {
375389 const known = new Set < string > ( ) ;
376390 const unknown = new Set < string > ( ) ;
@@ -576,6 +590,11 @@ function validateItem(item: ExtendedXmlNode, callbacks: ValidationCallbacks, ite
576590 callbacks . onGood ( socialInteract , `Found ${ itemTagName } <podcast:socialInteract>, nice!` , { tag : 'social-interact' , reference : socialInteractReference } ) ;
577591 }
578592
593+ // PHASE 6
594+
595+ // podcast:txt
596+ checkPodcastTxt ( 'item' , item , callbacks ) ;
597+
579598 // PROPOSALS
580599
581600 // (none at the moment)
0 commit comments