Skip to content

Commit

Permalink
Merge branch 'feature-flexmark-0.62.2' of https://github.com/cheeseng…
Browse files Browse the repository at this point in the history
…/scalatest into cheeseng-feature-flexmark-0.62.2
  • Loading branch information
bvenners committed Jul 25, 2021
2 parents 548c708 + 7e8a66f commit 78568ae
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -725,3 +725,5 @@ fromGreaterThanToHavingSizesBetween=The from value passed to havingSizesBetween,
analysis=Analysis:

deprecatedChosenStyleWarning=Warning: The chosen style has been deprecated and will be removed in future version of ScalaTest, because each style trait will be available as its own module.

flexmarkClassNotFound=Flexmark Pegdown adapter class not found, please add flexmark-all (https://mvnrepository.com/artifact/com.vladsch.flexmark/flexmark/0.62.2) to your test classpath.
59 changes: 36 additions & 23 deletions jvm/core/src/main/scala/org/scalatest/tools/HtmlReporter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ import Suite.unparsedXml
import Suite.xmlContent
import org.scalatest.exceptions.TestFailedException

import com.vladsch.flexmark.profiles.pegdown.Extensions
import com.vladsch.flexmark.profiles.pegdown.PegdownOptionsAdapter
import com.vladsch.flexmark.parser.PegdownExtensions
import com.vladsch.flexmark.profile.pegdown.PegdownOptionsAdapter
import com.vladsch.flexmark.parser.Parser
import com.vladsch.flexmark.html.HtmlRenderer

Expand Down Expand Up @@ -113,8 +113,16 @@ private[scalatest] class HtmlReporter(
copyResource(getResource("images/graybullet.gif"), imagesDir, "infoprovided.gif")

private val results = resultHolder.getOrElse(new SuiteResultHolder)

try {
Class.forName("com.vladsch.flexmark.profile.pegdown.PegdownOptionsAdapter")
}
catch {
case _: ClassNotFoundException =>
new ClassNotFoundException(Resources.flexmarkClassNotFound)

This comment has been minimized.

Copy link
@nafg

nafg Jul 5, 2022

Contributor

Is this missing a throw?

}

private val pegdownOptions = PegdownOptionsAdapter.flexmarkOptions(Extensions.ALL)
private val pegdownOptions = PegdownOptionsAdapter.flexmarkOptions(PegdownExtensions.ALL)
private val markdownParser = Parser.builder(pegdownOptions).build()
private val htmlRenderer = HtmlRenderer.builder(pegdownOptions).build()

Expand Down Expand Up @@ -242,23 +250,27 @@ private[scalatest] class HtmlReporter(
}
}
<script type="text/javascript">
//<![CDATA[
function toggleDetails(contentId, linkId) {
var ele = document.getElementById(contentId);
var text = document.getElementById(linkId);
if(ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "(Show Details)";
{
unparsedXml(
"""
function toggleDetails(contentId, linkId) {
var ele = document.getElementById(contentId);
var text = document.getElementById(linkId);
if(ele.style.display == "block") {
ele.style.display = "none";
text.innerHTML = "(Show Details)";
}
else {
ele.style.display = "block";
text.innerHTML = "(Hide Details)";
}
}
else {
ele.style.display = "block";
text.innerHTML = "(Hide Details)";
function hideOpenInNewTabIfRequired() {
if (top === self) { document.getElementById('printlink').style.display = 'none'; }
}
}
function hideOpenInNewTabIfRequired() {
if (top === self) { document.getElementById('printlink').style.display = 'none'; }
}
//]]>
"""
)
}
</script>
</head>
<body class="specification">
Expand Down Expand Up @@ -524,7 +536,9 @@ private[scalatest] class HtmlReporter(
<script type="text/javascript" src="js/d3.v2.min.js"></script>
<script type="text/javascript" src="js/sorttable.js"></script>
<script type="text/javascript">
//<![CDATA[
{
unparsedXml(
"""
var tagMap = {};
var SUCCEEDED_BIT = 1;
var FAILED_BIT = 2;
Expand Down Expand Up @@ -565,8 +579,9 @@ private[scalatest] class HtmlReporter(
detailsView.style.left = left + "px";
detailsView.style.width = (window.innerWidth - left - 30) + "px";
detailsView.style.height = (window.innerHeight - headerView.offsetHeight - 20) + "px";
}
//]]>
}"""
)
}
</script>
</head>
<body onresize="resizeDetailsView()">
Expand Down Expand Up @@ -626,9 +641,7 @@ private[scalatest] class HtmlReporter(
{ unparsedXml(tagMapScript) }
</script>
<script type="text/javascript">
//<![CDATA[
resizeDetailsView();
//]]>
</script>
</body>
</html>
Expand Down
2 changes: 1 addition & 1 deletion project/BuildCommons.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ trait BuildCommons {

val plusJUnitVersion = "3.2.9.0"
val plusTestNGVersion = "3.2.9.0"
val flexmarkVersion = "0.36.8"
val flexmarkVersion = "0.62.2"

def rootProject: Project

Expand Down

0 comments on commit 78568ae

Please sign in to comment.