[TASK] Updated Examples for Usage 46/54546/2
authorDandy Umlauft <noreply@example.com>
Fri, 3 Nov 2017 16:49:12 +0000 (17:49 +0100)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Mon, 6 Nov 2017 11:55:25 +0000 (12:55 +0100)
Added default and inline usage for the optional attribute "allowedTags"

Maybe you have to think about the name, cause in
http://php.net/manual/de/function.strip-tags.php the second parameter is
called "allowableTags", and not "allowedTags" This can lead to a quick
overlooked error ;)

Releases: master
Resolves: #82912
Change-Id: Icc3cab9a931790e621f5593ea487c9b23b779e30
Reviewed-on: https://review.typo3.org/54546
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Reviewed-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Tested-by: Morton Jonuschat <m.jonuschat@mojocode.de>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/fluid/Classes/ViewHelpers/Format/StripTagsViewHelper.php

index 8601728..3aee6f9 100644 (file)
@@ -32,6 +32,13 @@ use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderS
  * Some Text with Tags and an &Uuml;mlaut. (strip_tags() applied. Note: encoded entities are not decoded)
  * </output>
  *
+ * <code title="default notation with allowedTags">
+ * <f:format.stripTags allowedTags="<p><span><div><script>"><p>paragraph</p><span>span</span><div>divider</div><iframe>iframe</iframe><script>script</script></f:format.stripTags>
+ * </code>
+ * <output>
+ * <p>paragraph</p><span>span</span><div>divider</div>iframe<script>script</script>
+ * </output>
+ *
  * <code title="inline notation">
  * {text -> f:format.stripTags()}
  * </code>
@@ -39,6 +46,13 @@ use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithContentArgumentAndRenderS
  * Text without tags (strip_tags() applied)
  * </output>
  *
+ * <code title="inline notation with allowedTags">
+ * {text -> f:format.stripTags(allowedTags: "<p><span><div><script>")}
+ * </code>
+ * <output>
+ * Text with p, span, div and script Tags inside, all other tags are removed
+ * </output>
+ *
  * @api
  */
 class StripTagsViewHelper extends AbstractViewHelper