Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
343 stars 230 forks source link

html HREF v. net HREF #1777

Closed d-torrance closed 3 years ago

d-torrance commented 3 years ago

net HREF ignores all arguments after the second and doesn't properly format the arguments it doesn't ignore:

i1 : beginDocumentation()

i2 : href = HREF("https://foo.com", EM "foo", SPAN "bar", BOLD "baz");

i3 : html href

o3 = <a href="https://foo.com"><em>foo</em><span>bar</span><b>baz</b></a>

i4 : net href

o4 = EM{foo} (see https://foo.com )

This is visible when you run help on a package with a gold star, e.g., from help "Cremona". See the link to the git repository in the final sentence:

     Certification a gold star
     =========================

     Version 4.2.2 of this package was accepted for publication in volume 8
     (see https://msp.org/jsag/2018/8-1/ ) of The Journal of Software for
     Algebra and Geometry (see http://j-sag.org/ ) on 11 June 2018, in the
     article A Macaulay2 package for computations with rational maps (see
     https://msp.org/jsag/2018/8-1/p06.xhtml ). That version can be obtained
     from the journal (see https://msp.org/jsag/2018/8-1/jsag-v8-n1-x06-Cremona
     .zip ) or from (the ,EM{Macaulay2}, source code repository) (see
     http://github.com/Macaulay2/M2/blob/
     2e87a29e4b5b68af1bd8917a9c76d4008ff9fc5b/M2/Macaulay2/packages/Cremona.m2
     ).
DanGrayson commented 3 years ago

HREF should be given just 2 arguments, and they should both be strings. The first is the URL, and the second is something to display instead of the URL. So the problem goes back to commit 17fcfe4bee.

d-torrance commented 3 years ago

It looks like HREF's behavior changed to allow more arguments in https://github.com/Macaulay2/M2/commit/8bfd3ca68cbf1f793c93a2512d4a756452b3f7b7.

mahrud commented 3 years ago

Why can't HREF contain other hypertext objects? In almost all places net is trying to replicate how browsers present html, so I would think the fix should be to put html r instead here: https://github.com/Macaulay2/M2/blob/2a7d81a7f4443b855de7f095a8b51ab4ce3c956c/M2/Macaulay2/m2/html.m2#L140

DanGrayson commented 3 years ago

Why can't HREF contain other hypertext objects? In almost all places net is trying to replicate how browsers present html, so I would think the fix should be to put html r instead here: https://github.com/Macaulay2/M2/blob/2a7d81a7f4443b855de7f095a8b51ab4ce3c956c/M2/Macaulay2/m2/html.m2#L140

Okay, yes, I think you're right.