Repository: Mogztter/asciidoctor-pdf.js (js)

Issue:
Use other delimiter for stylesheet override
I would suggest to use a different delimiter than `;` for accepting multiple stylesheets, e.g.  `,`
Because `;` is also a command delimiter for shell so it can easily lead to `command not found` errors, which is not obvious and can take a while to understand the reason. e.g.
```
$ asciidoctor-pdf -a stylesheet=asciidoctor.css;document.css mydoc.adoc
...
bash: document.css: command not found
```
At least adjust the example in the readme:
> The stylesheet attribute can accept multiple semi-colon delimited values (without spaces). For example -a stylesheet=asciidoctor.css;override.css. This could be used to begin with a base stylesheet and then apply supplementary content.

Pull request description:
resolves #189 Use other delimiter for stylesheet override 
This resolves #189 by changing the stylesheet delimiter to be a comma `,`.
Be aware that this is a breaking change.

Patch:
diff --git a/README.md b/README.md
index a6341a3..00ca910 100644
--- a/README.md
+++ b/README.md
@@ -201,16 +201,25 @@ The title page is enabled if either of these conditions are met:
 $ asciidoctor-pdf document.adoc -a title-page
 ```
 
-**Additional styles**
+**Custom styles**
 
-You can provide a custom stylesheet using the `stylesheet` attribute.
-You can also specify where the stylesheet is located with the `stylesdir` attribute.
+You can provide a custom stylesheet using the `stylesheet` attribute. A custom stylesheet does completely replace the default stylesheet.
 
-    $ asciidoctor-pdf document.adoc -a stylesheet=custom.css
+    $ asciidoctor-pdf document.adoc -a stylesheet="custom.css"
+
+The `stylesheet` attribute can accept multiple comma delimited values (without spaces).
+This can be used to begin with a base stylesheet and then apply supplementary content.
+
+    $ asciidoctor-pdf document.adoc -a stylesheet="custom.css,override.css"
+
+It's also possible to use the default stylesheet and add custom styles with a custom stylesheet. All default stylesheets are available under the prefix `asciidoctor-pdf/css/`:
+
+    $ asciidoctor-pdf document.adoc -a stylesheet="asciidoctor-pdf/css/asciidoctor.css,asciidoctor-pdf/css/document.css,custom.css"
+
+You can also specify where the stylesheets are located with the `stylesdir` attribute.
+
+    $ asciidoctor-pdf document.adoc -a stylesdir=css -a stylesheet="custom.css,override.css"
 
-The `stylesheet` attribute can accept multiple semi-colon delimited values (without spaces).
-For example `-a stylesheet=asciidoctor.css;override.css`.
-This could be used to begin with a base stylesheet and then apply supplementary content.
 
 ## Custom layout
 
diff --git a/lib/document/document-converter.js b/lib/document/document-converter.js
index 88a0965..5a10dad 100644
--- a/lib/document/document-converter.js
+++ b/lib/document/document-converter.js
@@ -267,7 +267,7 @@ ${node.getContent()}
     const stylesheetAttribute = node.getAttribute('stylesheet')
     if (stylesheetAttribute && stylesheetAttribute.trim() !== '') {
       return stylesheetAttribute
-        .split(';')
+        .split(',')
         .map(value => value.trim())
         .filter(value => value !== '')
         .map(stylesheet => {


Test patch:
diff --git a/test/pdf_test.js b/test/pdf_test.js
index e96e476..defca36 100644
--- a/test/pdf_test.js
+++ b/test/pdf_test.js
@@ -317,7 +317,7 @@ describe('PDF converter', function () {
     opts.attributes = {}
     opts.attributes.reproducible = ''
     opts.to_file = outputFile
-    opts.attributes = { stylesheet: `${__dirname}/../css/asciidoctor.css;${__dirname}/../css/document.css;${__dirname}/../css/features/book.css;${__dirname}/fixtures/black-title-page.css` }
+    opts.attributes = { stylesheet: `${__dirname}/../css/asciidoctor.css,${__dirname}/../css/document.css,${__dirname}/../css/features/book.css,${__dirname}/fixtures/black-title-page.css` }
     await converter.convert(asciidoctor, { path: `${__dirname}/fixtures/title-page.adoc` }, opts, false)
     expect(outputFile).to.be.visuallyIdentical('title-page-background-color.pdf')
   })
diff --git a/test/templates_test.js b/test/templates_test.js
index dd18108..f15e572 100644
--- a/test/templates_test.js
+++ b/test/templates_test.js
@@ -102,7 +102,7 @@ Guillaume Grossetie
   })
 
   it('should load multiple stylesheets', () => {
-    const doc = asciidoctor.load('Hello world', { attributes: { stylesheet: `${__dirname}/fixtures/variable.css; ;${__dirname}/fixtures/theme.css;` } })
+    const doc = asciidoctor.load('Hello world', { attributes: { stylesheet: `${__dirname}/fixtures/variable.css, ,${__dirname}/fixtures/theme.css,` } })
     const $ = cheerio.load(doc.convert({ header_footer: true }))
     expect($('head').html()).to.not.have.string('Asciidoctor default stylesheet')
     expect($(`head > link[href="${__dirname}/fixtures/variable.css"]`).length).to.equal(1)