emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Couple of small fixes in exporting node.js and css content.
@ 2014-08-05  3:25 Josh Berry
  0 siblings, 0 replies; 3+ messages in thread
From: Josh Berry @ 2014-08-05  3:25 UTC (permalink / raw)
  To: org mode


[-- Attachment #1.1: Type: text/plain, Size: 924 bytes --]

I've got a toy paper I'm writing where I ran into a couple of issues
exporting to html.  The first issue is related to exporting the source of a
css block that contains proprietary properties.  In short, it looks like a
list is generated for the font face, where a single value was expected.

The second issue may be my fault, so if there is a setting I should change
on my end, apologies and I'll set said setting.  Basically, there is a
cutoff value whereby node.js will insert newlines into the results.  This
was incredibly frustrating as what was turning into a decent looking table
would suddenly become garbage.

In both cases, I did not add a test file.  If it is enough to just copy an
existing test file and trim it down to just these two items, I can
certainly do that.

Finally, apologies if I am doing this incorrectly.  I tried following the
directions on how to contribute as well as I could.

Thanks!

-josh

[-- Attachment #1.2: Type: text/html, Size: 1078 bytes --]

[-- Attachment #2: 0001-Fix-css-export-when-proprietary-properties-are-used.patch --]
[-- Type: text/x-patch, Size: 1013 bytes --]

From 0441982a9457f9bbd953a06ab4fa830c6ffc967b Mon Sep 17 00:00:00 2001
From: Josh Berry <taeric@gmail.com>
Date: Mon, 4 Aug 2014 22:45:43 -0400
Subject: [PATCH 1/2] Fix css export when proprietary properties are used

* htmlize.el (htmlize-face-size): Check for a list instead of a single
  font face.

`face-attribute' does not act kindly to being given a list of faces.

TINYCHANGE
---
 contrib/lisp/htmlize.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lisp/htmlize.el b/contrib/lisp/htmlize.el
index 3bf5949..6654f40 100644
--- a/contrib/lisp/htmlize.el
+++ b/contrib/lisp/htmlize.el
@@ -1079,7 +1079,7 @@ If no rgb.txt file is found, return nil."
   (let ((size-list
 	 (loop
 	  for f = face then (face-attribute f :inherit)
-	  until (or (not f) (eq f 'unspecified))
+	  until (or (not f) (eq f 'unspecified) (listp f))
 	  for h = (face-attribute f :height)
 	  collect (if (eq h 'unspecified) nil h))))
     (reduce 'htmlize-merge-size (cons nil size-list))))
-- 
1.9.1


[-- Attachment #3: 0002-Fix-javascript-exporting-of-results-from-node.js.patch --]
[-- Type: text/x-patch, Size: 1601 bytes --]

From 792b89a0922ee21bd0155f68adb0ce07c2558a51 Mon Sep 17 00:00:00 2001
From: Josh Berry <taeric@gmail.com>
Date: Mon, 4 Aug 2014 22:46:46 -0400
Subject: [PATCH 2/2] Fix javascript exporting of results from node.js

* ob-js.el (org-babel-js-read): Expand regexps to account for newlines
  in output from node.js

It may be possible to instruct node.js to not insert line breaks
automatically.  Was not difficult to fix the regular expressions to
account for newlines, though.

I did *not* add a test file that goes over this, as I did not see one
already for ob-js.el.  I can certainly add one, if desired.

TINYCHANGE
---
 lisp/ob-js.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-js.el b/lisp/ob-js.el
index 7789449..9d956cc 100644
--- a/lisp/ob-js.el
+++ b/lisp/ob-js.el
@@ -97,13 +97,13 @@ This function is called by `org-babel-execute-src-block'"
 If RESULTS look like a table, then convert them into an
 Emacs-lisp table, otherwise return the results as a string."
   (org-babel-read
-   (if (and (stringp results) (string-match "^\\[.+\\]$" results))
+   (if (and (stringp results) (string-match "^\\[[\0-\377[:nonascii:]]*\\]$" results))
        (org-babel-read
         (concat "'"
                 (replace-regexp-in-string
                  "\\[" "(" (replace-regexp-in-string
                             "\\]" ")" (replace-regexp-in-string
-                                       ", " " " (replace-regexp-in-string
+                                       ",\\W" " " (replace-regexp-in-string
 						 "'" "\"" results))))))
      results)))
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] Couple of small fixes in exporting node.js and css content.
@ 2014-08-05 15:41 Josh Berry
  0 siblings, 0 replies; 3+ messages in thread
From: Josh Berry @ 2014-08-05 15:41 UTC (permalink / raw)
  To: org mode


[-- Attachment #1.1: Type: text/plain, Size: 996 bytes --]

I've got a toy paper I'm writing where I ran into a couple of issues
exporting to html.  The first issue is related to exporting the source of a
css block that contains proprietary properties.  In short, it looks like a
list is generated for the font face, where a single value was expected.

The second issue may be my fault, so if there is a setting I should change
on my end, apologies and I'll set said setting.  Basically, there is a
cutoff value whereby node.js will insert newlines into the results.  This
was incredibly frustrating as what was turning into a decent looking table
would suddenly become garbage.

In both cases, I did not add a test file.  If it is enough to just copy an
existing test file and trim it down to just these two items, I can
certainly do that.

Finally, apologies if I am doing this incorrectly.  I tried following the
directions on how to contribute as well as I could.

Thanks!

-josh

p.s.  The toy paper is here: http://taeric.github.io/DancingLinks.html

[-- Attachment #1.2: Type: text/html, Size: 1411 bytes --]

[-- Attachment #2: 0001-Fix-css-export-when-proprietary-properties-are-used.patch --]
[-- Type: text/x-patch, Size: 1013 bytes --]

From 0441982a9457f9bbd953a06ab4fa830c6ffc967b Mon Sep 17 00:00:00 2001
From: Josh Berry <taeric@gmail.com>
Date: Mon, 4 Aug 2014 22:45:43 -0400
Subject: [PATCH 1/2] Fix css export when proprietary properties are used

* htmlize.el (htmlize-face-size): Check for a list instead of a single
  font face.

`face-attribute' does not act kindly to being given a list of faces.

TINYCHANGE
---
 contrib/lisp/htmlize.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lisp/htmlize.el b/contrib/lisp/htmlize.el
index 3bf5949..6654f40 100644
--- a/contrib/lisp/htmlize.el
+++ b/contrib/lisp/htmlize.el
@@ -1079,7 +1079,7 @@ If no rgb.txt file is found, return nil."
   (let ((size-list
 	 (loop
 	  for f = face then (face-attribute f :inherit)
-	  until (or (not f) (eq f 'unspecified))
+	  until (or (not f) (eq f 'unspecified) (listp f))
 	  for h = (face-attribute f :height)
 	  collect (if (eq h 'unspecified) nil h))))
     (reduce 'htmlize-merge-size (cons nil size-list))))
-- 
1.9.1


[-- Attachment #3: 0002-Fix-javascript-exporting-of-results-from-node.js.patch --]
[-- Type: text/x-patch, Size: 1601 bytes --]

From 792b89a0922ee21bd0155f68adb0ce07c2558a51 Mon Sep 17 00:00:00 2001
From: Josh Berry <taeric@gmail.com>
Date: Mon, 4 Aug 2014 22:46:46 -0400
Subject: [PATCH 2/2] Fix javascript exporting of results from node.js

* ob-js.el (org-babel-js-read): Expand regexps to account for newlines
  in output from node.js

It may be possible to instruct node.js to not insert line breaks
automatically.  Was not difficult to fix the regular expressions to
account for newlines, though.

I did *not* add a test file that goes over this, as I did not see one
already for ob-js.el.  I can certainly add one, if desired.

TINYCHANGE
---
 lisp/ob-js.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/ob-js.el b/lisp/ob-js.el
index 7789449..9d956cc 100644
--- a/lisp/ob-js.el
+++ b/lisp/ob-js.el
@@ -97,13 +97,13 @@ This function is called by `org-babel-execute-src-block'"
 If RESULTS look like a table, then convert them into an
 Emacs-lisp table, otherwise return the results as a string."
   (org-babel-read
-   (if (and (stringp results) (string-match "^\\[.+\\]$" results))
+   (if (and (stringp results) (string-match "^\\[[\0-\377[:nonascii:]]*\\]$" results))
        (org-babel-read
         (concat "'"
                 (replace-regexp-in-string
                  "\\[" "(" (replace-regexp-in-string
                             "\\]" ")" (replace-regexp-in-string
-                                       ", " " " (replace-regexp-in-string
+                                       ",\\W" " " (replace-regexp-in-string
 						 "'" "\"" results))))))
      results)))
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] Couple of small fixes in exporting node.js and css content.
@ 2014-08-05 15:44 Josh Berry
  0 siblings, 0 replies; 3+ messages in thread
From: Josh Berry @ 2014-08-05 15:44 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1014 bytes --]

I've got a toy paper I'm writing where I ran into a couple of issues
exporting to html.  The first issue is related to exporting the source of a
css block that contains proprietary properties.  In short, it looks like a
list is generated for the font face, where a single value was expected.

The second issue may be my fault, so if there is a setting I should change
on my end, apologies and I'll set said setting.  Basically, there is a
cutoff value whereby node.js will insert newlines into the results.  This
was incredibly frustrating as what was turning into a decent looking table
would suddenly become garbage.

In both cases, I did not add a test file.  If it is enough to just copy an
existing test file and trim it down to just these two items, I can
certainly do that.

Finally, apologies if I am doing this incorrectly.  I tried following the
directions on how to contribute as well as I could.

Thanks!

-josh

p.s.  The toy paper is here: http://taeric.github.io/DancingLinks.html
Feedback welcome!

[-- Attachment #2: Type: text/html, Size: 1378 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-05 15:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-05  3:25 [PATCH] Couple of small fixes in exporting node.js and css content Josh Berry
  -- strict thread matches above, loose matches on Subject: below --
2014-08-05 15:41 Josh Berry
2014-08-05 15:44 Josh Berry

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).