Commit 67a248ae authored by yann300's avatar yann300

fix html rendering

parent 2b91c6a7
......@@ -40,7 +40,12 @@ Renderer.prototype.error = function (message, container, options) {
if (!opt.type) {
opt.type = utils.errortype(message)
}
var $pre = $(opt.useSpan ? '<span />' : '<pre />').text(message)
var $pre
if (opt.isHTML) {
$pre = $(opt.useSpan ? '<span />' : '<pre />').html(message)
} else {
$pre = $(opt.useSpan ? '<span />' : '<pre />').text(message)
}
var $error = $('<div class="sol ' + opt.type + '"><div class="close"><i class="fa fa-close"></i></div></div>').prepend($pre)
if (container === undefined) {
container = $('#output')
......
......@@ -18,7 +18,7 @@ gasCosts.prototype.report = function (compilationResults) {
if (fallback !== undefined) {
if (fallback === null || fallback >= 2100) {
report.push({
warning: `Fallback function of contract ${contractName} requires too much gas (${fallback}).\n
warning: `Fallback function of contract ${contractName} requires too much gas (${fallback}).<br />
If the fallback function requires more than 2300 gas, the contract cannot receive Ether.`
})
}
......@@ -32,7 +32,7 @@ gasCosts.prototype.report = function (compilationResults) {
var gasString = gas === null ? 'unknown or not constant' : 'high: ' + gas
if (gas === null || gas >= 3000000) {
report.push({
warning: `Gas requirement of function ${contractName}.${functionName} ${gasString}.\n
warning: `Gas requirement of function ${contractName}.${functionName} ${gasString}.<br />
If the gas requirement of a function is higher than the block gas limit, it cannot be executed.
Please avoid loops in your functions or actions that modify large areas of storage
(this includes clearing or copying arrays in storage)`
......
......@@ -19,7 +19,7 @@ txOrigin.prototype.visit = function (node) {
txOrigin.prototype.report = function () {
return this.txOriginNodes.map(function (item, i) {
return {
warning: `use of tx.origin: "tx.origin" is useful only in very exceptional cases.\n
warning: `use of tx.origin: "tx.origin" is useful only in very exceptional cases.<br />
If you use it for authentication, you usually want to replace it by "msg.sender", because otherwise any contract you call can act on your behalf.`,
location: item.src
}
......
......@@ -78,7 +78,7 @@ staticAnalysisView.prototype.run = function () {
location = self.offsetToColumnConverter.offsetToLineColumn(location, file, self.editor, self.lastCompilationResult)
location = self.lastCompilationResult.sourceList[file] + ':' + (location.start.line + 1) + ':' + (location.start.column + 1) + ':'
}
self.renderer.error(location + ' ' + item.warning, warningContainer, {type: 'warning', useSpan: true})
self.renderer.error(location + ' ' + item.warning, warningContainer, {type: 'warning', useSpan: true, isHTML: true})
})
})
if (warningContainer.html() === '') {
......
......@@ -33,7 +33,6 @@ function runTests (browser) {
browser
.waitForElementVisible('.newFile', 10000)
contractHelper.testContracts(browser, sources.sources.Untitled, ['TooMuchGas', 'test1', 'test2'], function () {
console.log('pppzzz?')
browser
.click('.staticanalysisView')
.click('#staticanalysisView button')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment