Commit graph

310 commits

Author SHA1 Message Date
Wil Mahan
c2756ebfa1 Fix problem with RFC magic links, as noted at bug 479 2004-09-26 17:59:08 +00:00
Wil Mahan
e1ea27cf2e Don't strip leading ':' in maybeDoSubpageLink() so that
{{:foo}} works for including from main namespace.
2004-09-25 20:35:38 +00:00
Wil Mahan
2f54e9b50e Fix bug 561: {{/Subpage}} acts like {{Template:/Subpage}}, by
breaking out a maybeDoSubpageLink() function and using it when
including a template.
2004-09-25 20:13:14 +00:00
Wil Mahan
446f11bafc Move tidy call from Parser to OutputPage so that it happens
after link placeholder replacement.
2004-09-25 18:22:21 +00:00
Wil Mahan
7bd759a966 Undo some of my changes to sections from templates; I think they
were wrong
2004-09-25 16:06:10 +00:00
Wil Mahan
90d2ccd96a Fix two parser bugs: bug 41 and bug 529. For the former, I replaced
a broken check for '{{{' in braceSubstitution(). For the latter,
I undid part of JeLuF's fix to bug 523 and changed
braceSubstitution() to add a newline '{|', '#', '*', ';', or ':'
come at the beginning of a template and a newline isn't already
present. Also, minor cleanups to the template section code.
2004-09-25 05:16:38 +00:00
Wil Mahan
4860983705 Another attempt at fixing bug 2. Call replaceInternalLinks() before
replaceExternalLinks(). Use placeholders for interwiki links, as with
other internal links, to avoid parsing them as external. Disallow
links to pages containing a URL protocol followed by a colon.
Unrelated: output a warning comment when a template loop is detected.
2004-09-24 18:29:01 +00:00
Zheng Zhu
2d244b91f7 Attempt to fix links not fixed in the wgLang->wgContLang transition 2004-09-24 18:24:01 +00:00
Zheng Zhu
f84493db51 First batch of files modified to switch wgLang to wgContLang. 2004-09-24 13:14:52 +00:00
Wil Mahan
122d818923 Fix bug in pre-save transform caught by tester 2004-09-24 02:38:20 +00:00
Wil Mahan
b541d3bf4b Revert previous change, which broke interwiki links. 2004-09-23 07:25:02 +00:00
Wil Mahan
1c9c17f675 Call replaceExternalLinks after replaceInternalLinks. Fixes bug 2 and
a related bug.
2004-09-23 07:16:05 +00:00
Wil Mahan
e3179bba15 Remove a space for parser checker consistency 2004-09-23 06:29:46 +00:00
Wil Mahan
6cc7b51210 Don't unstrip() in internalParse(), because it's already done in parse().
This fixes <nowiki>*list item</nowiki>, which was caught thanks to the
parser tester. :)
2004-09-22 20:04:11 +00:00
Jens Frank
d5a30ef7ac Fixed some typos 2004-09-22 17:46:13 +00:00
Zheng Zhu
40cd22b4a9 use wgContLang to convert among different language variants 2004-09-22 03:51:32 +00:00
Wil Mahan
5c2b2730ff Now it is straightforward to fix bug 89, subst: template parameters.
Initial patch thanks to alanyst@gmail.com.
2004-09-22 00:15:54 +00:00
Wil Mahan
1962304c6a Two somewhat experimental changes before I fix bug 89:
1) Don't suspend the LinkCache when including templates;
because we don't call replaceInternalLinks() anymore,
it doesn't do anything.
2) Don't call strip(), removeHTMLcomments(), or replaceVariables()
on template parameters in argSubstitution(). The first two
should already be done on the article including the template,
and the third is unnecessary because it isn't possible to
pass templates as parameters to templates.

These seem to work, but if anybody notices any problems,
please let me know.
2004-09-21 23:56:25 +00:00
Wil Mahan
16fa7c3461 Removing variableSubstitution broke passing magic variables as template
parameters, so restore it. Instead, remove magic variable substitution
from braceSubstitution(), and modify variableSubstitution to handle magic
variables prefixed by SUBST in the pre-save transform.
2004-09-21 23:30:46 +00:00
River Tarnell
94cf4c9892 remove extraneous wfDebug 2004-09-21 19:05:46 +00:00
River Tarnell
dbdac8ca5b don't error on certain inputs if $matches[] doesn't have a last element 2004-09-21 19:03:39 +00:00
River Tarnell
7079cae2e2 use comments instead of __ so we don't scare the users if erroneous ones creep in 2004-09-21 18:20:56 +00:00
River Tarnell
a8eda05b9c fix a problem by not inserting __MWTEMPLATESECTION for section titles that don't exist 2004-09-21 18:15:37 +00:00
River Tarnell
de6c1e0330 forwardport fixes for template section edit links from rel1_3 2004-09-21 16:56:48 +00:00
River Tarnell
721cfd758c fix: inclusion of non-existent template is broken.
this still appears to be broken, but I think it was broken before this code existed as well.
2004-09-21 12:11:17 +00:00
River Tarnell
2c32f7df21 fix for several problems found by Eloquence:
section edit links in nested templates didn't work;
edit links for subsections in templates didn't work.

pending: links for non-existent templates are broken.
2004-09-21 11:54:45 +00:00
River Tarnell
2478dbdec4 make section headers in templates have edit links that point to the template. 2004-09-21 08:31:25 +00:00
River Tarnell
c10861fdf7 fix bug where __MWTEMPLATESECTION__ was being used with subst: 2004-09-21 06:54:18 +00:00
Wil Mahan
a90a2eb09b Convert many comments to phpdoc style, and document some more functions 2004-09-21 05:49:12 +00:00
Wil Mahan
11ddbffa71 Completely remove variableSubstitution(), because magic variable
replacement is redundantly done in braceSubstitution(). Aside
from removing unnecessary code, this will make it easier to fix
bug 89, parameters to {{subst:}} templates
2004-09-21 05:12:44 +00:00
River Tarnell
2242d6ed62 don't put edit links on sections from included templates.
template section headings have __MWTEMPLATESECTION__ added to them;
formatHeadings removes this and doesn't add the edit link for
such sections.  this is a rather hackish fix, but is probably
the best we can do with the current parser setup.

it would be nice (but not important) if this could be extended to
let users prevent edit links for certain sections.

fixes bug #266
2004-09-21 04:33:51 +00:00
Jens Frank
100316948f Instead of storing entire link attributes in wikitext for
deleayed link colouring, store pointer to an entry in array wgLinkHolders. Fixes BUG#493 and should
be faster.
2004-09-20 23:02:08 +00:00
Antoine Musso
9e1cd2016a Fix bug 479 : parsing [[RFC 1234]] as internal link
I forgot to commit it :(
2004-09-20 21:41:26 +00:00
Wil Mahan
d8d8b99f5b Fix small corner case in HTML comment removal 2004-09-20 16:05:37 +00:00
Jens Frank
a38fd104b0 BUG#487 Use Wil's custom function to replace HTML comments instead of
a regular expression. It is much more robust for different test cases, e.g.
*abc
<!-- comment -->def
2004-09-20 06:17:04 +00:00
Wil Mahan
87fe496e8f Remove code that is unnecessary now that titles no longer contain
'{' or '}'; fix regex greediness bug in HTML comment removal.
2004-09-19 08:58:09 +00:00
Jens Frank
d42c91a23c BUG#93 Fix handling of <nowiki> in templates 2004-09-18 23:14:07 +00:00
Jens Frank
9a3b767c7d BUG#523 Don't remove newlines in front of templates or template variables 2004-09-18 21:02:27 +00:00
Jens Frank
55e6114499 BUG#60 Patch by Wil Mahan
Include templates instead of parsing them. Than, parse the whole wikitext
in one step
2004-09-17 06:15:12 +00:00
Jens Frank
ff264a485a Added convert() to Language class, so that convert can be called
without checking wgLanguageCode. Avoid hardcodes.
2004-09-17 05:51:03 +00:00
Zheng Zhu
6ab460a578 Added entry point to call the Traditional/Simplified Chinese conversion code in LanguageZh.php 2004-09-16 20:25:12 +00:00
Jens Frank
7d89fde3f6 BUG#487 make regex not-so-greedy. If anchored to end-of-line, several lines are eaten if
there is text following the comment
2004-09-15 05:53:21 +00:00
Brion Vibber
8d704a7942 Whoops, debugging comment. 2004-09-14 06:02:01 +00:00
Brion Vibber
63d80f72c1 Prudency measure: only enable $wgRawHtml usage if $wgWhitelistEdit is on. 2004-09-14 05:49:15 +00:00
Jens Frank
2429d63748 BUG#463 Strip first leading blank from preformatted text in output 2004-09-12 13:07:52 +00:00
Brion Vibber
b0c2c0449d Use <i> and <b> for '' and ''' instead of <em> and <strong>. There's no
good reason to use <em> and <strong> here; they increase cache storage
and bandwidth requirements ;) and may be abusing semantic markup.

* Bug 369: '' should be interpreted as <i>, not <em>
http://bugzilla.wikipedia.org/show_bug.cgi?id=369
* Bug 370: ''' should be interpreted as <b>, not <strong>
http://bugzilla.wikipedia.org/show_bug.cgi?id=370
2004-09-11 08:40:26 +00:00
River Tarnell
5012260a95 here is the correct fix for head (MF 1.3) 2004-09-09 23:24:36 +00:00
River Tarnell
b19e0b60ce don't parse blank ISBNs 2004-09-09 23:04:08 +00:00
Jens Frank
227b54cbfd BUG#76 For categories, don't use the Category:-prefix for the sortkey.
[[Category:Mountains of Panama]] now gets cl_sortkey='Mountains of Panama' instead of 'Category:Mountains of Panama'.
Avoids later issues with sorting.
2004-09-07 22:08:01 +00:00
Antoine Musso
ba2afcd9fa Split files and classes in different packages for phpdocumentor. I probably changed some double quotes to single and used function foo () { shema 2004-09-03 23:00:01 +00:00