#10637: Implement sage -sws2rst
------------------------------------------------------------+---------------
Reporter: nthiery | Owner:
jason, mpatel, was
Type: enhancement | Status:
needs_work
Priority: major | Milestone:
sage-5.3
Component: notebook | Resolution:
Keywords: ReST, worksheet | Work issues:
answer questions, math formatting, lists, maybe absolute paths?
Report Upstream: Workaround found; Bug reported upstream. | Reviewers:
Nicolas ThiƩry, Jason Grout, Karl-Dieter Crisman, Jason Bandlow, John Palmieri
Authors: Pablo Angulo, Karl-Dieter Crisman | Merged in:
Dependencies: #11080, #11459 | Stopgaps:
------------------------------------------------------------+---------------
Comment (by pang):
Replying to [comment:59 kcrisman]:
> * $$ that are intended to be empty LaTeX for later filling in -
definitely counts on $$ always existing in pairs
I work around a possible problem if $$ and <p>...</p> are not correctly
nested, because I observed that this happens, but I assumed that there is
no unpaired $$ because the jsmath in the notebook makes that kind of
mistake pretty obvious.
> * I'm not sure about the replace_courier thing. Are you saying that
you, personally, use Courier font to indicate code in TinyMCE, and this is
how you replace it with <code></code> tags? It would be nice for this to
be customizable; otherwise, what happens to the poor sap who happens to
like Courier and then finds all their text replaced by code?
Done: I don't use that function any more
> * It looks like in visiting ordered lists, that all sublists will
automatically becomes numbered. But couldn't one have an unordered list
inside an ordered list?
Solved
> * in the replace_latex thing, is it conceivable that the re's would
match something by mistake? It looks like e.g. latex_beginning is
matching anything that starts and ends with a dollar sign, as long as it
really does end with a dollar sign and not \$, where that would include
any character (possibly zero) before that. Again, in a well-formed
worksheet that wouldn't be a problem, but maybe sometimes people would do
things like "$\$$".
Nice catch! I've taken care of that.
> * Or what if the TinyMCE was (completely) "h$x+y=z$", then wouldn't this
get replaced by ":math:`x+y=z`" with the h gone? It seems like you're
assuming \\1 is a whitespace character?
Nope, I collect that char too.
> * How could the branch of visit_strong with _inside_code_tag be reached?
The only place this flag seems to be True is in visit_code, but in that
case one just gets plain text and and wouldn't visit_strong, it seems to
me
You're damn right.
> * What if there was an anchor tag that was NOT an "href"? There are
other uses for anchors.
ok, done.
> * There is potential for malformed {{{///}}} or }}} without the others
or cell id's missing and | missing to cause trouble
Yes, but that's not tinyMCE dependent, and I haven't seen it fail. With
any parser, there is wrong input that will produce problems.
> * <p> could be appended to no purpose; I guess this counts heavily on
all tags being properly paired
can you give an example? I've tried several configurations and
BeautifulSoup seems pretty robust
> * Is it conceivable that the rest will do something wrong with the
escape_chars + and friends when it's not replaced? I assume not since
they're turned into :math: mode
not sure I understand, haven't seen any problem in this line
> * Am I correct in saying that once inside a code tag, all other tags are
ignored? That appears to be what is going on here.
That's correct. That was probably to deal with <code>var =
<strong>my_func</strong>(spam, eggs)</code>, but if you'd rather do
something else I'd like to know.
> * In the table, I suppose it's at least possible there could be a tfoot
element. Does this not come out of TinyMCE?
No, TinyMCE does not use the footer, but it's no big deal: now we take
care of both.
> * What other preformatted text <pre> do we expect? Should they all be
::'ed?
please detail
> * I know this might not happen a lot, but in theory a cell could do
sage: sage: sage: and it should all be removed... not that this is a very
big deal.
forgot that one, so I'll leave that to a further patch
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10637#comment:72>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.