Seite 1 von 1

small bug in HTMLBuilders.scala

Verfasst: 12. Feb 2014 02:53
von burgi
Hi,

just for clarification, should the given addElement method not only add one single newline character (/n) ? Otherwise I see some problems to get the same Sourcecode indentation as the given example html files.

Given one:

Code: Alles auswählen

 
def addElement(tag: String, attributes: String, content: String) {
    addTag(tag, attributes)
    code += content += "</" += tag += ">\n\n"
  }
Correct one ?:

Code: Alles auswählen

 def addElement(tag: String, attributes: String, content: String) {
    addTag(tag, attributes)
    code += content += "</" += tag += ">\n"
}
Greetings Dominic

Re: small bug in HTMLBuilders.scala

Verfasst: 12. Feb 2014 09:13
von imaier
Interesting, I need to check my reference implementation. I am pretty sure that the samples were generated with that addElement method. Anyhow, you are of course open to make minor changes to the code template to suit your needs.

Cheers,
Ingo

Re: small bug in HTMLBuilders.scala

Verfasst: 12. Feb 2014 10:53
von burgi
Hi Ingo,

no need to check it works with this double newline, I did a failure in mind,

Greetings Dominic

Re: small bug in HTMLBuilders.scala

Verfasst: 12. Feb 2014 11:03
von imaier
No wait. I just noticed that the html samples are totally scrambled. Sorry for that. I have committed an update for the project template. There shouldn't be a newline at all. If you have one now, that's okay, we are mostly interested in correct indentation. Whether you have some newlines here or there is not so important. But please note the indentation in the new samples. The old ones were not correct!

Thanks for bringing this up,
Ingo