Repository: jtablesaw/tablesaw
Pull request #501 (2019-03-23 22:33:59)

removed camel case and underscore help from html writer
Thanks for contributing.

- [x ] Tick to sign-off your agreement to the [Developer Certificate of Origin (DCO) 1.1](https://developercertificate.org)

## Description

removed special handling for camel and snake case in column names

## Testing

updated existing test


Patch:
diff --git a/html/src/main/java/tech/tablesaw/io/html/HtmlWriter.java b/html/src/main/java/tech/tablesaw/io/html/HtmlWriter.java
index 542f5ae0..8f07c781 100644
--- a/html/src/main/java/tech/tablesaw/io/html/HtmlWriter.java
+++ b/html/src/main/java/tech/tablesaw/io/html/HtmlWriter.java
@@ -14,15 +14,7 @@
 
 package tech.tablesaw.io.html;
 
-import static tech.tablesaw.io.ParsingUtils.splitCamelCase;
-import static tech.tablesaw.io.ParsingUtils.splitOnUnderscore;
-
-import java.io.IOException;
-import java.io.Writer;
-import java.util.List;
-
 import org.jsoup.nodes.Element;
-
 import tech.tablesaw.api.Table;
 import tech.tablesaw.columns.Column;
 import tech.tablesaw.io.DataWriter;
@@ -30,6 +22,10 @@ import tech.tablesaw.io.Destination;
 import tech.tablesaw.io.WriterRegistry;
 import tech.tablesaw.io.html.HtmlWriteOptions.ElementCreator;
 
+import java.io.IOException;
+import java.io.Writer;
+import java.util.List;
+
 public class HtmlWriter implements DataWriter<HtmlWriteOptions> {
 
     private static final HtmlWriter INSTANCE = new HtmlWriter();
@@ -77,7 +73,7 @@ public class HtmlWriter implements DataWriter<HtmlWriteOptions> {
         thead.appendChild(tr);
         for (Column<?> col : cols) {
             tr.appendChild(elements.create("th", col, null)
-                .append(splitCamelCase(splitOnUnderscore(col.name()))));
+                .append(col.name()));
         }
         return thead;
     }


Test patch:
diff --git a/core/src/test/java/tech/tablesaw/io/html/HtmlWriterTest.java b/core/src/test/java/tech/tablesaw/io/html/HtmlWriterTest.java
index 3f9fc698..57b7cc39 100644
--- a/core/src/test/java/tech/tablesaw/io/html/HtmlWriterTest.java
+++ b/core/src/test/java/tech/tablesaw/io/html/HtmlWriterTest.java
@@ -14,20 +14,19 @@
 
 package tech.tablesaw.io.html;
 
-import static java.lang.Double.NaN;
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
 import org.jsoup.nodes.Element;
 import org.junit.jupiter.api.Test;
-
 import tech.tablesaw.api.DoubleColumn;
 import tech.tablesaw.api.Table;
 import tech.tablesaw.io.html.HtmlWriteOptions.ElementCreator;
 
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+
+import static java.lang.Double.NaN;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
 public class HtmlWriterTest {
 
     private static final String LINE_END = System.lineSeparator();
@@ -46,7 +45,7 @@ public class HtmlWriterTest {
                 " <thead>" + LINE_END +
                 "  <tr>" + LINE_END +
                 "   <th>v</th>" + LINE_END +
-                "   <th>v 2</th>" + LINE_END +
+                "   <th>v2</th>" + LINE_END +
                 "  </tr>" + LINE_END +
                 " </thead>" + LINE_END +
                 " <tbody>" + LINE_END +
@@ -82,7 +81,7 @@ public class HtmlWriterTest {
                 " <thead>" + LINE_END +
                 "  <tr>" + LINE_END +
                 "   <th>v</th>" + LINE_END +
-                "   <th>v 2</th>" + LINE_END +
+                "   <th>v2</th>" + LINE_END +
                 "  </tr>" + LINE_END +
                 " </thead>" + LINE_END +
                 " <tbody>" + LINE_END +