small bug in HTMLBuilders.scala

burgi
BASIC-Programmierer
BASIC-Programmierer
Beiträge: 115
Registriert: 15. Apr 2009 18:08
Wohnort: Ludwigshafen

small bug in HTMLBuilders.scala

Beitrag 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

imaier
Mausschubser
Mausschubser
Beiträge: 61
Registriert: 21. Okt 2013 21:27

Re: small bug in HTMLBuilders.scala

Beitrag 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

burgi
BASIC-Programmierer
BASIC-Programmierer
Beiträge: 115
Registriert: 15. Apr 2009 18:08
Wohnort: Ludwigshafen

Re: small bug in HTMLBuilders.scala

Beitrag von burgi »

Hi Ingo,

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

Greetings Dominic

imaier
Mausschubser
Mausschubser
Beiträge: 61
Registriert: 21. Okt 2013 21:27

Re: small bug in HTMLBuilders.scala

Beitrag 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

Antworten

Zurück zu „Archiv“