diff --git a/.travis.yml b/.travis.yml index 00cb1c7..abb11bd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,9 @@ python: - "3.5" - "3.6" - "3.7" - - "3.8-dev" + - "3.8" + - "3.9" + - "3.10-dev" # command to run tests script: cd test/ && python run_tests.py diff --git a/README.rst b/README.rst index aa7bb04..d5c4422 100644 --- a/README.rst +++ b/README.rst @@ -56,6 +56,8 @@ Argument Description `encode` turn on/off[default] encoding of result to escaped html, compatible with any browser --------------------- ---------------- `escape` turn on[default]/off escaping of html tags in text nodes (prevents XSS attacks in case you pass untrusted data to json2html) +--------------------- ---------------- +`multiline` turn on/off[default] using HTML line breaks in multiline text nodes ===================== ================ Installation diff --git a/json2html/jsonconv.py b/json2html/jsonconv.py index 9ef8c73..f8c8292 100644 --- a/json2html/jsonconv.py +++ b/json2html/jsonconv.py @@ -33,7 +33,7 @@ class Json2Html: - def convert(self, json="", table_attributes='border="1"', clubbing=True, encode=False, escape=True): + def convert(self, json="", table_attributes='border="1"', clubbing=True, encode=False, escape=True, multiline=False): """ Convert JSON to HTML Table format """ @@ -42,6 +42,7 @@ def convert(self, json="", table_attributes='border="1"', clubbing=True, encode= self.table_init_markup = "