Permalink
Browse files

Switch to class="test" instead of class="commenttest" (fixes #22)

  • Loading branch information...
boxed committed Mar 30, 2013
1 parent d81f915 commit ebe46df4f8468d5accf63fa059bb4509c55e9838
Showing with 7 additions and 7 deletions.
  1. +4 −4 doctest.css
  2. +3 −3 doctest.js
View
@@ -10,23 +10,23 @@ pre {
/* Test block formatting: */
-pre.doctest, pre.commenttest {
+pre.doctest, pre.commenttest, pre.test {
border: 1px solid #999;
border-radius: 4px;
}
-pre.doctest.doctest-some-failure, pre.commenttest.doctest-some-failure {
+pre.doctest.doctest-some-failure, pre.commenttest.doctest-some-failure, pre.test.doctest-some-failure {
border: 1px solid #f00;
}
/* FIXME: it would be nice if this was more obviously styled to show that there
was more content */
-pre.commenttest.expand-on-failure, pre.doctest.expand-on-failure {
+pre.doctest.expand-on-failure, pre.commenttest.expand-on-failure, pre.test.expand-on-failure {
max-height: 3em;
overflow-y: auto;
}
-pre.commenttest.expand-on-failure.doctest-some-failure, pre.doctest.expand-on-failure.doctest-some-failure {
+pre.doctest.expand-on-failure.doctest-some-failure, pre.commenttest.expand-on-failure.doctest-some-failure, pre.test.expand-on-failure.doctest-some-failure {
max-height: none;
}
View
@@ -960,7 +960,7 @@ var HTMLParser = exports.HTMLParser = function (runner, containerEl, selector) {
throw 'Bad/null/missing containerEl';
}
this.containerEl = containerEl;
- this.selector = selector || 'pre.doctest, pre.commenttest';
+ this.selector = selector || 'pre.doctest, pre.commenttest, pre.test';
};
HTMLParser.prototype = {
@@ -987,7 +987,7 @@ HTMLParser.prototype = {
var examples;
if (hasClass(el, 'doctest')) {
examples = this.parseDoctestEl(el);
- } else if (hasClass(el, 'commenttest')) {
+ } else if (hasClass(el, 'commenttest') || hasClass(el, 'test')) {
examples = this.parseCommentEl(el);
} else {
throw 'Unknown element class/type';
@@ -1190,7 +1190,7 @@ HTMLParser.prototype = {
fillElement: function (el, text) {
el.innerHTML = '';
- if (hasClass(el, 'commenttest')) {
+ if (hasClass(el, 'commenttest') || hasClass(el, 'test')) {
var texts = this.splitText(text);
if (texts && texts.length) {
for (var i=0; i<texts.length; i++) {

0 comments on commit ebe46df

Please sign in to comment.