From 9b55a7557090c423368934263b0ea3a15513a351 Mon Sep 17 00:00:00 2001 From: Jacques Distler Date: Fri, 27 Apr 2007 21:52:29 -0500 Subject: [PATCH] More SVG Elements and Attributes Added and , as well as a slew of related SVG attributes. Also an SVG-related stylesheet tweak --- lib/sanitize.rb | 32 +++++++++++++++++--------------- public/stylesheets/instiki.css | 6 +++++- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/lib/sanitize.rb b/lib/sanitize.rb index 81895738..4a816018 100644 --- a/lib/sanitize.rb +++ b/lib/sanitize.rb @@ -27,9 +27,9 @@ module Sanitize svg_elements = ['a', 'animate', 'animateColor', 'animateMotion', 'animateTransform', 'circle', 'defs', 'desc', 'ellipse', 'font-face', 'font-face-name', 'font-face-src', 'g', 'glyph', 'hkern', 'image', - 'linearGradient', 'line', 'metadata', 'missing-glyph', 'mpath', 'path', - 'polygon', 'polyline', 'radialGradient', 'rect', 'set', 'stop', 'svg', - 'switch', 'text', 'title', 'use'] + 'linearGradient', 'line', 'marker', 'metadata', 'missing-glyph', + 'mpath', 'path', 'polygon', 'polyline', 'radialGradient', 'rect', + 'set', 'stop', 'svg', 'switch', 'text', 'title', 'tspan', 'use'] acceptable_attributes = ['abbr', 'accept', 'accept-charset', 'accesskey', 'action', 'align', 'alt', 'axis', 'border', 'cellpadding', @@ -58,21 +58,23 @@ module Sanitize svg_attributes = ['accent-height', 'accumulate', 'additive', 'alphabetic', 'arabic-form', 'ascent', 'attributeName', 'attributeType', 'baseProfile', 'bbox', 'begin', 'by', 'calcMode', 'cap-height', - 'class', 'color', 'color-rendering', 'content', 'cx', 'cy', 'd', - 'descent', 'display', 'dur', 'end', 'fill', 'fill-rule', 'font-family', - 'font-size', 'font-stretch', 'font-style', 'font-variant', + 'class', 'color', 'color-rendering', 'content', 'cx', 'cy', 'd', 'dx', + 'dy', 'descent', 'display', 'dur', 'end', 'fill', 'fill-rule', + 'font-family', 'font-size', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'from', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'gradientUnits', 'hanging', 'height', 'horiz-adv-x', 'horiz-origin-x', 'id', 'ideographic', 'k', 'keyPoints', 'keySplines', 'keyTimes', - 'lang', 'mathematical', 'max', 'min', 'name', 'offset', 'opacity', - 'origin', 'overline-position', 'overline-thickness', 'panose-1', - 'path', 'pathLength', 'points', 'preserveAspectRatio', 'r', - 'repeatCount', 'repeatDur', 'requiredExtensions', 'requiredFeatures', - 'restart', 'rotate', 'rx', 'ry', 'slope', 'stemh', 'stemv', - 'stop-color', 'stop-opacity', 'strikethrough-position', - 'strikethrough-thickness', 'stroke', 'stroke-dasharray', - 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', - 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'systemLanguage', 'target', + 'lang', 'marker-end', 'marker-mid', 'marker-start', 'markerHeight', + 'markerUnits', 'markerWidth', 'mathematical', 'max', 'min', 'name', + 'offset', 'opacity', 'orient', 'origin', 'overline-position', + 'overline-thickness', 'panose-1', 'path', 'pathLength', 'points', + 'preserveAspectRatio', 'r', 'refX', 'refY', 'repeatCount', 'repeatDur', + 'requiredExtensions', 'requiredFeatures', 'restart', 'rotate', 'rx', + 'ry', 'slope', 'stemh', 'stemv', 'stop-color', 'stop-opacity', + 'strikethrough-position', 'strikethrough-thickness', 'stroke', + 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', + 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', + 'stroke-width', 'systemLanguage', 'target', 'text-anchor', 'to', 'transform', 'type', 'u1', 'u2', 'underline-position', 'underline-thickness', 'unicode', 'unicode-range', 'units-per-em', 'values', 'version', 'viewBox', diff --git a/public/stylesheets/instiki.css b/public/stylesheets/instiki.css index 986b3aa8..4fb88d1d 100644 --- a/public/stylesheets/instiki.css +++ b/public/stylesheets/instiki.css @@ -386,4 +386,8 @@ span.keyboard { margin-left:5px; padding:1px 2px; } - +.centeredfigure { + position:relative; + margin:auto; + text-align:center; +}