Commit Graph

14 Commits

Author SHA1 Message Date
Ethan Vizitei 3f706051c4 Add the directionality plugin for tinymce
closes CNVS-19413

folks have been requesting RTL support.  This uses
tinymce's core plugin to provide it.  Unfortunately that adds
another two buttons to the toolbar.  :(

wraps the directionality plugin in an AMD wrapper, and adds it
to our default configuration

Also prevents canvas from stripping out the "dir" element
when HTML scrubbing

TEST PLAN:
 - go to any RCE
 - see the two new buttons for RTL and LTR
 - use them to change back and forth, make sure it doesn't break
 - ensure that our custom plugins don't interact badly with it. (I've
   done a cursory code read and some clicking around, but that would
   be my biggest concern)

Change-Id: I0884b65a99ec0e1db8c6abd82711a35799a062dd
Reviewed-on: https://gerrit.instructure.com/50672
QA-Review: August Thornton <august@instructure.com>
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
Product-Review: Ethan Vizitei <evizitei@instructure.com>
2015-03-20 21:32:29 +00:00
Ethan Vizitei 13daa43d2d Don't strip out lang attributes when sanitizing html
fixes CNVS-18648

This was suspected to be a tinymce problem,
but tiny wasn't stripping lang at all (which
is why the reporter was confused that it was
in the white list).

This adds rspec (and therefore specs)
and the sanitize dependency
to the canvas_sanitize gem, adds a spec
that proves the sanitization problem was in here,
and then changes the default config to allow the
lang element to show up on html elements.

TEST PLAN:
 - Open an RCE in Canvas
 - Use the HTML editor and paste in <p lang="es"> Hola. Como estas?</p>p>
 - Save
 - Edit and verify that the lang attribute hasn't been stripped

Change-Id: Iff9129a8cbff4b4efd004e619ef92c7395dda568
Reviewed-on: https://gerrit.instructure.com/50255
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Dan Minkevitch <dan@instructure.com>
Tested-by: Jenkins
QA-Review: Jahnavi Yetukuri <jyetukuri@instructure.com>
2015-03-16 21:18:11 +00:00
Brad Humphrey 60e60a8688 add allowfullscreen tags to the rce
test plan:
- add add a video in an iframe in the rich content editor
- it should be able to become full screen

fixes PLAT-647

Change-Id: I05ad81fdebc32353af9746605e9847947e614582
Reviewed-on: https://gerrit.instructure.com/41728
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Nathan Mills <nathanm@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Brad Humphrey <brad@instructure.com>
2014-09-26 15:20:45 +00:00
Paul Hinze 071d6d8a96 align rspec version in gems with parent
update spec_helpers to fix deprecation warning after upgrade

Change-Id: I31b370d1d60f73d5256c69a8d5e69418657f880d
Reviewed-on: https://gerrit.instructure.com/39144
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
Product-Review: Paul Hinze <paulh@instructure.com>
QA-Review: Paul Hinze <paulh@instructure.com>
2014-08-12 22:27:39 +00:00
Sterling Cobb ad0efde549 add accessiblity to sanitization
fixes CNVS-13697

When you create html markup in canvas, you should be able to add
accessible attributes and roles to elements. This commit allows you to
do that.

Test Plan

As a user that can edit a wiki page
When you edit a wiki page
And you toggle to edit the html
Then you add an aria attribute like aria-label
And you toggle back to the yswyg editor
And you toggle back into the html view
Then aria elements should still be on the html elements
And they should still be there when you save the page and inspect the
elements via developer tools.

Change-Id: Id443170fb3eabcbfcec58fd29b6fcfe1ea71279a
Reviewed-on: https://gerrit.instructure.com/36627
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Clare Strong <clare@instructure.com>
Product-Review: Hilary Scharton <hilary@instructure.com>
2014-07-03 20:28:32 +00:00
James Williams 58868f9cd4 allow video and audio html tags in html content
test plan:
* try to add audio and video tags in html content
* should not remove the tags when saving

closes #CNVS-9660

Change-Id: I46e363d2150f16a07ec8cf096be8b7652c437254
Reviewed-on: https://gerrit.instructure.com/36594
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2014-06-30 15:58:53 +00:00
James Williams 520af09347 don't sanitize title attributes in html content
test plan:
* try to save html content with a title attibute on an
 html element other than a or img:
 e.g. "<p title='a title'>text</p>"
* the attribute should not be removed

closes #CNVS-8357

Change-Id: Ib6bf534a75aa30fff8efc6345189114ff3718e1c
Reviewed-on: https://gerrit.instructure.com/36590
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
Product-Review: Jeremy Stanley <jeremy@instructure.com>
QA-Review: Caleb Guanzon <cguanzon@instructure.com>
2014-06-30 15:58:48 +00:00
Shawn Meredith e6de56a029 spec: vendored_gems pin rspec versions
Change-Id: Ibad1c172e58a69eb3a5a9ff2c874e861086ae227
Reviewed-on: https://gerrit.instructure.com/35756
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-06-03 14:54:02 +00:00
James Williams 8b63a0d85f allow h1 tags in html sanitation
test plan:
* add html content including one or more h1 tags
 (e.g. "<h1>Header</h1>")
* confirm that it retains the tags rather than
 stripping them out

fixes #CNVS-12321

Change-Id: I74dd56aced493255b2f8a5834d2a5a841de6d910
Reviewed-on: https://gerrit.instructure.com/33139
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
Product-Review: Ryan Florence <ryanf@instructure.com>
2014-04-17 04:33:02 +00:00
Shawn Meredith 89b2072df3 spec: canvas rspec rake task for vendored_gems
Change-Id: I8aceb8e5aa2b95790eadca83725c8fd03bd28965
Reviewed-on: https://gerrit.instructure.com/30621
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-02-24 05:47:34 +00:00
Jeremy Stanley 6dbbd8d9f8 fix style-sanitizing regex
in commit 8ae4ba8e, the regex was modified to accept negative
values (e.g., -1.0em), making the \w-\w clause redundant and
causing extremely slow matching in certain pathological cases.

test plan:
 - import the Angel package attached to the ticket
 - it should complete in a reasonable time (a few minutes,
   probably) and definitely should not max out your CPU
   for three hours while making no visible progress

fixes CNVS-10820

Change-Id: I582386c25d4d99f362ce2411b0c387bc958a71c5
Reviewed-on: https://gerrit.instructure.com/30074
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Bracken Mosbacker <bracken@instructure.com>
Product-Review: Bracken Mosbacker <bracken@instructure.com>
QA-Review: Nathan Rogowski <nathan@instructure.com>
2014-02-14 16:41:56 +00:00
Simon Williams 63830287ea don't use git to build vendored gem specification file list
fixes CNVS-11072

test plan: in a canvas repository without a .git directory (like a deploy) call
a bundle command (like script/console).  it should not give you warnings about
missing .git directories

Change-Id: I2daa1371d97c94f7c3db81d3fd2bad387fcabaf8
Reviewed-on: https://gerrit.instructure.com/29947
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-12 22:58:25 +00:00
Raphael Weiner 9044087ae1 use test.sh scripts for all gems
Change-Id: If97bbe476b8bf747e3b83bb7bf22783e2508da69
Reviewed-on: https://gerrit.instructure.com/29507
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
QA-Review: Stephan Hagemann <stephan@pivotallabs.com>
2014-02-04 22:23:57 +00:00
Raphael Weiner 91944495c2 convert sanitize field plugin into proper gem: CanvasSanitize
Change-Id: I5562a318bb3f52c1374a3a69f288bfb2381f8ee7
Reviewed-on: https://gerrit.instructure.com/29405
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Stephan Hagemann <stephan@pivotallabs.com>
Product-Review: Stephan Hagemann <stephan@pivotallabs.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
QA-Review: Brian Palmer <brianp@instructure.com>
2014-01-28 22:36:18 +00:00