選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

165 行
4.9KB

  1. Configuration naming
  2. HTML Purifier 4.0.0 features a new configuration naming system that
  3. allows arbitrary nesting of namespaces. While there are certain cases
  4. in which using two namespaces is obviously better (the canonical example
  5. is where we were using AutoFormatParam to contain directives for AutoFormat
  6. parameters), it is unclear whether or not a general migration to highly
  7. namespaced directives is a good idea or not.
  8. == Case studies ==
  9. === Attr.* ===
  10. We have a dead duck HTML.Attr.Name.UseCDATA which migrated before we decided
  11. to think this out thoroughly.
  12. We currently have a large number of directives in the Attr.* namespace.
  13. These directives tweak the behavior of some HTML attributes. They have
  14. the properties:
  15. * While they apply to only one attribute at a time, the attribute can
  16. span over multiple elements (not necessarily all attributes, either).
  17. The information of which elements it impacts is either omitted or
  18. informally stated (EnableID applies to all elements, DefaultImageAlt
  19. applies to <img> tags, AllowedRev doesn't say but only applies to a tags).
  20. * There is a certain degree of clustering that could be applied, especially
  21. to the ID directives. The clustering could be done with respect to
  22. what element/attribute was used, i.e.
  23. *.id -> EnableID, IDBlacklistRegexp, IDBlacklist, IDPrefixLocal, IDPrefix
  24. img.src -> DefaultInvalidImage
  25. img.alt -> DefaultImageAlt, DefaultInvalidImageAlt
  26. bdo.dir -> DefaultTextDir
  27. a.rel -> AllowedRel
  28. a.rev -> AllowedRev
  29. a.target -> AllowedFrameTargets
  30. a.name -> Name.UseCDATA
  31. * The directives often reference generic attribute types that were specified
  32. in the DTD/specification. However, some of the behavior specifically relies
  33. on the fact that other use cases of the attribute are not, at current,
  34. supported by HTML Purifier.
  35. AllowedRel, AllowedRev -> heavily <a> specific; if <link> ends up being
  36. allowed, we will also have to give users specificity there (we also
  37. want to preserve generality) DTD %Linktypes, HTML5 distinguishes
  38. between <link> and <a>/<area>
  39. AllowedFrameTargets -> heavily <a> specific, but also used by <area>
  40. and <form>. Transitional DTD %FrameTarget, not present in strict,
  41. HTML5 calls them "browsing contexts"
  42. Default*Image* -> as a default parameter, is almost entirely exlcusive
  43. to <img>
  44. EnableID -> global attribute
  45. Name.UseCDATA -> heavily <a> specific, but has heavy other usage by
  46. many things
  47. == AutoFormat.* ==
  48. These have the fairly normal pluggable architecture that lends itself to
  49. large amounts of namespaces (pluggability may be the key to figuring
  50. out when gratuitous namespacing is good.) Properties:
  51. * Boolean directives are fair game for being namespaced: for example,
  52. RemoveEmpty.RemoveNbsp triggers RemoveEmpty.RemoveNbsp.Exceptions,
  53. the latter of which only makes sense when RemoveEmpty.RemoveNbsp
  54. is set to true. (The same applies to RemoveNbsp too)
  55. The AutoFormat string is a bit long, but is the only bit of repeated
  56. context.
  57. == Core.* ==
  58. Core is the potpourri of directives, mostly regarding some minor behavioral
  59. tweaks for HTML handling abilities.
  60. AggressivelyFixLt
  61. ConvertDocumentToFragment
  62. DirectLexLineNumberSyncInterval
  63. LexerImpl
  64. MaintainLineNumbers
  65. Lexer
  66. CollectErrors
  67. Language
  68. Error handling (Language is ostensibly a little more general, but
  69. it's only used for error handling right now)
  70. ColorKeywords
  71. CSS and HTML
  72. Encoding
  73. EscapeNonASCIICharacters
  74. Character encoding
  75. EscapeInvalidChildren
  76. EscapeInvalidTags
  77. HiddenElements
  78. RemoveInvalidImg
  79. Lexing/Output
  80. RemoveScriptContents
  81. Deprecated
  82. == HTML.* ==
  83. AllowedAttributes
  84. AllowedElements
  85. AllowedModules
  86. Allowed
  87. ForbiddenAttributes
  88. ForbiddenElements
  89. Element set tuning
  90. BlockWrapper
  91. Child def advanced twiddle
  92. CoreModules
  93. CustomDoctype
  94. Advanced HTMLModuleManager twiddles
  95. DefinitionID
  96. DefinitionRev
  97. Caching
  98. Doctype
  99. Parent
  100. Strict
  101. XHTML
  102. Global environment
  103. MaxImgLength
  104. Attribute twiddle? (applies to two attributes)
  105. Proprietary
  106. SafeEmbed
  107. SafeObject
  108. Trusted
  109. Extra functionality/tagsets
  110. TidyAdd
  111. TidyLevel
  112. TidyRemove
  113. Tidy
  114. == Output.* ==
  115. These directly affect the output of Generator. These are all advanced
  116. twiddles.
  117. == URI.* ==
  118. AllowedSchemes
  119. OverrideAllowedSchemes
  120. Scheme tuning
  121. Base
  122. DefaultScheme
  123. Host
  124. Global environment
  125. DefinitionID
  126. DefinitionRev
  127. Caching
  128. DisableExternalResources
  129. DisableExternal
  130. DisableResources
  131. Disable
  132. Contextual/authority tuning
  133. HostBlacklist
  134. Authority tuning
  135. MakeAbsolute
  136. MungeResources
  137. MungeSecretKey
  138. Munge
  139. Transformation behavior (munge can be grouped)