emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Josh Berry <taeric@gmail.com>
To: org mode <emacs-orgmode@gnu.org>
Subject: [PATCH] Couple of small fixes in exporting node.js and css content.
Date: Mon, 4 Aug 2014 23:25:33 -0400	[thread overview]
Message-ID: <CAG9v9NnV8OTr4BfzgPuxGoZqEO2s7d8BxHKT1MPo8q3b0QZ8yw@mail.gmail.com> (raw)


[-- 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


             reply	other threads:[~2014-08-05  3:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05  3:25 Josh Berry [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-08-05 15:41 [PATCH] Couple of small fixes in exporting node.js and css content Josh Berry
2014-08-05 15:44 Josh Berry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAG9v9NnV8OTr4BfzgPuxGoZqEO2s7d8BxHKT1MPo8q3b0QZ8yw@mail.gmail.com \
    --to=taeric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).