Help:Using HTML in Note Fields

The note fields of ISFDB Title and Publication records (and other record types that support note fields) permit HTML, Hyper Text Markup Language, to be entered as part of their text, and will display that HTML when the record is displayed in response to a database query. In theory a very wide variety of effects could be implemented in this way, but in practice only a few HTML constructs are used to avoid overly complex pages or security problems. Moderators have the option to question any HTML constructs other than those which are listed here.

This page lists the HTML constructs commonly used in ISFDB note fields, and describes how to enter them.

Conventions
On this page, HTML examples and their results are shown in  and actual tags are shown in.

If you edit this page or look at the wiki source you will see code and nowiki tags being used. Those are present to allow the examples to display properly -- they should NOT be part of any HTML you enter in ISFDB note fields. In the link examples, wikicode (square brackets) is used to make the results appear correctly, since a tags do not render correctly in wiki pages. Do not enter this into ISFDB note fields, use the forms displayed using the a tags instead.

Tags and Tag Pairs (An Intro to Basic HTML)
All HTML is entered as one or more Tags. A tag starts with a "<" character, and ends with a ">" character. The opening < is followed by code for the tag, which is one or more letters (or in some cases digits). This may be followed by a space and some parameters or settings, depending on the specific tag involved.

Tag Pairs
Most tags come in pairs, a start tag and a stop tag. The stop tag has a slash ("/") before its code. For example if there were a tag with the code "test" the start tag would be  , and the end tag would be  .

Tags may be nested, but not interleaved. For example, the following would be a valid case of nested tags:

The following is an example of INVALID interleaving of tags:

More simply stated: if a tag pair starts inside another tag pair, it must be closed before the outer tag pair is closed.

If a tag is part of a tag pair, it is important to enter a matching end tag for each start tag. Otherwise the tag's effect may continue onto the display page beyond the note field, causing an incorrect display of the rest of the ISFDB record.

There are some cases where the closing tag of a tag pair may safely be omitted. The only one commonly used in ISFDB note fields is the    tag, whose closing tag is optional.

Unpaired Tags
Some tags are not part of a tag pair, and do not require a matching close tag. The most common one used in ISFDB note fields is   , the line break (see the following section). Such tags may end with a space and a slash (/), to indicate that they are "self-closing". However, this is strictly optional for all such unpaired tags used in ISFDB note fields. This is true in all current versions of HTML and all current browsers. Moreover, future versions of HTML are expected to continue to support the form without the closing slash, so editors may use either form in ISFDB note fields.

Line breaks
Simply entering a return into a notes field will not cause a line break to display. A line break can be forced by using an HTML "break" tag. This is sometimes entered as ''' , but more often in the shortcut form   '''. The closing slash is strictly optional.

Italics
To display text in italics, such as for a book title, use the i tag. This is part of a tag pair, and MUST be closed or the rest of the record will be displayed in italics.

For example, this HTML:

would display like this:

Boldface
To display text in boldface, such as for emphasis, use the b tag. This is part of a tag pair, and MUST be closed or the rest of the record will be displayed in bold.

For example, this HTML:

would display like this:

Unlike italics, boldface is rarely used in ISFDB note fields. The use of boldface for titles is discouraged. Although the ISFDB is not bound to any particular citation style, most of them, including the most popular one created by the MLA (Modern Language Association), require that the titles of books and magazines (container publications) be entered using italics. The titles of shorter works which are contained in publications, like essays and stories, should be entered using standard double quotes.

Links
To create and display a hypertext link, use the a (anchor) tag. This is part of a tag pair, and MUST be closed or the rest of the record may not display at all.

The a tag has a single parameter, HREF. This gives the URL (web address) of the site to link to. The URL follows an equals sign and MUST be enclosed in double quotes to work correctly. That is, the full parameter is. The text between the start tag and the end tag will be shown as the NAME of the link, the text on which a user may click to follow the link. The link NAME need not be the same as the URL.

A hypertext link is most often used in an ISFDB record's note field to link the record to the Internet source from which data has been used and/or verified.

Be careful to enter only links which are relevant and useful to the record. Links to websites other than sources of data are very unusual and should be avoided. Title records now have a designated field to enter these links and HTML should not be used in this field. (But a complete URL is required.) Links in publication records should only be entered in the Note field, and HTML is required.

Only those links which are very likely to remain stable should be entered. If the link target changes, in the case of some websites that use "floating targets", it may lead a user to the wrong page. The information it was supposed to link to will not be visible to the ISFDB user, often with no easy way to find it. Of course, the editor of the record has the option of giving the source of the data without having to provide a link. If you are unsure whether a particular link or sort of link is stable, ask at the Help Desk before using it.
 * Library of Congress LCCN "permalinks" are stable.
 * Links to OCLC/Worldcat records by record number are stable.
 * Links to Project Gutenberg etexts by text number are stable.
 * Links to records in the Locus online database are NOT stable. Locus periodically reindexes, changing the page division points and thus the page ID for any particular reference. For this reason, links to Locus should not be entered into ISFDB note fields, as there is no way to automatically update them. Simply noting the source as "Locus1" is sufficient.
 * Links to the BLIC (British Library Integrated Catalogue) are NOT stable. They are tied to the viewing session and expire when the session ID does. No one at the ISFDB knows of a way to make a permanent link to the BLIC record by its catalog/record number. Such links should be removed when found.


 *  WARNING : You may see a target= parameter in links copied from other sites. This parameter tells the a web browser where to display the results of clicking on the link (and says nothing about what to display).  DO NOT use target= in links you add to the ISFDB, as doing so may interfere with the software's display management.  A link:
 * should be entered as:
 * should be entered as:

Linking Examples
This HTML link to the Library of Congress page for a specific Library of Congress Control Number:

would display like this:

-- This HTML link to a specific OCLC/Worldcat record:

would display like this:

Please note: searches on OCLC/Worldcat will result in URLs similar to this:

which can be converted to

and still link to the same record. (The text for this link is also available by clicking on the "Permalink" button/link at the top right of OCLC's pub details). Doing this will cut down on Note field clutter.

--

This HTML link to a Project Gutenberg version of an ebook:

would display like this:

Unnumbered Lists
To display an unnumbered or "bulleted" list, you use two types of tags. The ul (unnumbered list) tag starts and stops the entire list, and the li (list item) tag marks off individual items in the list.

Many editors use this construct to display a series of separate notations in the note field.

The ul tag MUST be closed properly with a  tag, or the rest of the record will display incorrectly as part of the list. You may see cases where the li tags do not have matching   tags. This will work correctly in all current web browsers and HTML versions, and the next version of the HTML standard (HTML5) explicitly permits it. Future versions of HTML are expected to support this also. Therefore closing  tags may be used or omitted in ISFDB note fields as each editor prefers, and there should be no difference in the resulting display.

It is possible to place one unnumbered list inside a single list item for another (outer) list. This is rarely done in ISFDB note fields, however, because (1) it is usually unnecessary, and (2) it makes editing more complex. Do not use this technique unless there is a clear need for it, and you are confident that you are closing both inner and outer lists correctly.

Examples of Lists
Here is an example of a complete unordered list.

This HTML:

would display like this:

-- Here is an example not using the closing    tags.

This HTML:

would also display like this:

It is not required that each list item starts on a new line, as shown in the examples above. The HTML will display a new line for each list item in any case. But it is easier to edit a note field when each list item tag starts a new line, and clearer what the HTML means. Most unnumbered lists in the ISFDB have been entered in this way.

HTML Entities
Some characters are reserved in HTML, and so should not be used in note fields. Instead, it is possible to use HTML Entities to display such characters.

For example, it is a very bad idea to use the less than (<) or greater than (>) signs in your note text, because the browser may mix them with tags. Even if it doesn't, error checking routines may complain about such text.

An HTML entity takes the form   -- the and sign (&) and semicolon are required. (It is also possible to use the form  .)

Here are some of the HTML entities that might be used in ISFDB note pages: For more information and a longer list, see this w3schools page.