Commit Graph

1316 Commits

Author SHA1 Message Date
Alex Schroeder
39f8e2045e (NewNamespaceScriptUrl): Try and handle
the case of namespaces containing non-ASCII characters. This
should be legal, but lead to problems when generating links to
pages in such namespaces. The URL encoding of the non-ASCII
characters prevented the $InterSitePattern from matching. Instead
of using this regular expression, we now try and guess at the
string using URL constraints ([^/?&;=]+), URL decoding it, and
then checking the $InterSitePattern.
2008-12-02 23:45:41 +00:00
Brian Curry
c0d70cb033 * modules/recaptcha.pl (ReCaptchaQuestionAddTo): Patched with a
Wiki-provided correction, courtesy Bayle Shanks. Apparently, the
previous regular expression in this function failed to match the
Comment form's HTML. This patch corrects that! The reCAPTCHA widget
is now properly displayed by both the Comment and Edit forms.
Thanks, Bayle. (http://bayleshanks.com)
2008-11-27 06:00:25 +00:00
Brian Curry
cbd6e12934 * modules/forms.pl (FormsRule): Removed Sidebar-specific hack.
Thanks, Alex!
2008-11-25 09:59:32 +00:00
Alex Schroeder
484c144e33 Added greek. 2008-11-24 18:09:42 +00:00
Alex Schroeder
198da7fbc4 New 2008-11-24 17:40:20 +00:00
Brian Curry
68b3a7f49e * modules/toc.pl (TocRule): Corrected a minor issue re: integration
with the Sidebar and Crossbar modules.
2008-11-24 03:48:17 +00:00
Brian Curry
a140c1dd42 * modules/crossbar.pl (UserCanEditCrossbar): Deleted.
(CrossbarInit): Permit non-administrators to edit crossbar pages.
(GetEditFormCrossbar): Added a message describing crossbar usage.
2008-11-24 03:39:14 +00:00
Brian Curry
451dac19bc * modules/creole.pl (CreoleRule): Implemented handling of so-called
"interlinks" -- i.e., links to external Wikis via the "$InterMap"
page. (So, Creole syntax is now embeddable within interlinks!)
2008-11-24 01:34:48 +00:00
Brian Curry
78c55c5783 * modules/crossbar.pl: New module. Provides a sustainable
replacement for the Sidebar module, for all Sidebar users
requiring a cleaner integration of that module with other modules
such as "toc.pl" and "footnotes.pl". This new module also improves
Sidebar customizability by permitting users to place the "Crossbar"
at any position in any page.
* modules/forms.pl (FormsRules): Generalized so as to support both
the Sidebar and Crossbar modules.
* modules/toc.pl (RunMyRulesToc): Generalized so as to support both
the Sidebar and Crossbar modules.
* t/crossbar.t: New test suite, testing the Crossbar module.
2008-11-23 22:13:29 +00:00
Brian Curry
4a1cbfb1b4 * wiki.pl (SetHtmlEnvironmentContainer): Corrected a slight, but
significant, typo.
* modules/sidebar.pl: Reverted. I underestimated the scope of
changes needed to bring this module in line with recent, other
changes to the Table of Contents module. The good news is that the
reverted Sidebar module now works as expected for all modules except
the Table of Contents module; of course, the bad news is that the
reverted Sidebar module no longer works for the Table of Contents
module. (Unfortunately, we can't have both, here.) I will be
recommitting my changes to this module as a new module, therefore,
named "modules/crossbar.pl" -- sometime, soon. That new module
will (probably) break backwards compatibility with this module, but
will otherwise behave as expected... with all modules.
* t/sidebar.t: Prevented testing against the Table of Contents
module, as the Sidebar module is now known not to work with that
module.
2008-11-20 11:45:45 +00:00
Brian Curry
609cb49f86 * wiki.pl (PrintWikiToHTML): Slightly reordered function calls,
so as to optimize a few edge cases.
2008-11-16 01:00:04 +00:00
Brian Curry
52a47946a6 * wiki.pl (RegisterBlockLevelElement): Renamed to
SetHtmlEnvironmentContainer (and changed in every other module,
where called).
2008-11-15 21:24:32 +00:00
Brian Curry
7cfe623133 * wiki.pl (AddHtmlEnvironment): Corrected a minor regression.
Probably not a genuine issue... but one can never tell.
* modules/creole.pl (CloseHtmlEnvironmentsCreole): Removed.
* modules/creoleaddition.pl (CloseHtmlEnvironmentsCreoleAddition):
Removed.
* modules/poetry.pl (CloseHtmlEnvironmentsPoetry): Removed.
2008-11-15 12:53:25 +00:00
Brian Curry
af3c7169ea * modules/sidebar.pl: Refactored. This is a complete rewrite
removing all previous module-specific hacks. However, as it is a
rewrite, it may still have issues. (Fortunately, time is the mother
of invention and bug fixes.)
* modules/toc.pl: Refactored. This is a complete rewrite
removing all previous module-specific hacks. As with "sidebar.pl",
it may still have issues. That said -- I'm relatively proud of it,
and confident that it (should) stand up under rigorous scrutinies,
utilization, and brutalization.
* modules/forms.pl (FormsRule): Slightly revised, so as to comply
with the "sidebar.pl" refactoring.
2008-11-15 12:48:13 +00:00
Brian Curry
b213cfb5a5 * modules/creole.pl (CreoleListAndNewLineRule): Corrected a regression
accidentally introduced by my last commit! Yay.
2008-11-11 23:58:24 +00:00
Brian Curry
7e06c38c1b * modules/poetry.pl ($PoetryIsHandlingXMLStyleMarkup): New option.
($PoetryIsHandlingCreoleStyleMarkup): New option.
(PoetryRule): Utilized new options, so as to permit several markup
styles, and simplified implementation, according to recent
refactoring in "wiki.pl".
(CloseHtmlEnvironmentsPoetry): New function, permitting block-level
elements (e.g., lists, tables) within poems.
2008-11-11 04:50:46 +00:00
Brian Curry
4088200a99 * modules/creole.pl (CreoleRule): Corrected a horrific link-caching
issue with my last commit. Apologies to those who've already
installed the last commit: this one should be (substantially!) more
stable.
2008-11-10 15:53:22 +00:00
Brian Curry
0b38a69cd0 * modules/creole.pl (CreoleRule): Simplified implementation and
integrated with improvements to CreoleHeaderRule().
(CreoleHeaderRule): Improved -- remarkably. Header markup may now
include all other (non-bol) markup, with exception of link markup
producing a dirty HTML block. ("Dirty" link markup in header
markup is stripped out, as appropriate.)
(CreoleListAndNewlineRule): Simplified implementation.
(CreoleRuleRecursive): Supported the global @HtmlAttrStack.
(GetCreoleLinkHtml): New function, reducing code-bloat.
* modules/creoleaddition.pl (CreoleAdditionRule): Simplified
implementation; and handled small caps markup properly, now.
2008-11-06 10:11:02 +00:00
Brian Curry
a2990672b0 * modules/toc.pl (TocInit): Context-sensitively set the
"$TocConvertH1TagsToH2Tags" option, if not already set.
Basically, we only need the option enabled when the Usemod
markup module is also installed.
2008-11-05 10:11:48 +00:00
Brian Curry
d6ba0b66ec * wiki.pl (@HtmlAttrStack): New global variable. This permits
the InElement() and [Add|Close]HtmlEnvironment() family of
functions to add, remove, and search against HTML tag attributes
for all recently stacked HTML tag environments. Previously, tag
attributes were not retained; they were simply returned as text
from the AddHtmlEnvironment() function. Markup modules producing
complex HTML -- particularly, complex HTML having deeply nested
span or div tags -- can leverage the newly rewritten functions,
below, to simplify, streamline, and "clean up" their markup code.
(InElement): Rewritten to use this new variable.
(AddHtmlEnvironment): Rewritten to use this new variable.
(CloseHtmlEnvironment): Rewritten to use this new variable.
(CloseHtmlEnvironments): Rewritten to use this new variable.
(CloseHtmlEnvironmentUntil): Rewritten to use this new variable.
(AddOrCloseHtmlEnvironment): New function. Added so as to avoid
duplicate redefinition in the Creole, Creole Addition, and Usemod
modules.
* modules/usemod.pl (UsemodRule): Corrected erroneous usage of the
InElement() function. (I don't think UsemodRule()	was ever quite
right, really; it's a bit surprising it worked this long!)
2008-11-05 09:42:05 +00:00
Brian Curry
4efcaa483f * modules/toc.pl ($TocIsConvertingH1TagsToH2Tags): Renamed from
"$TocConvertH1TagsToH2Tags".
2008-11-05 06:19:18 +00:00
Brian Curry
de766937bb * modules/toc.pl ($TocConvertH1TagsToH2Tags): New option.
(TocRule): Use the new option; principally, this permits Wiki
administrators to prevent this module from converting
"<h1>...</h1>" tags "<h2>...</h2>" tags.
2008-11-05 03:30:04 +00:00
Alex Schroeder
8cd9c99d3f *** empty log message *** 2008-10-29 15:55:41 +00:00
Alex Schroeder
41a5bca092 (DoTranslationLink): Add more explanation.
($TranslationLinkHelpPage): New option.
2008-10-29 15:55:25 +00:00
Alex Schroeder
fb1e630445 (DoTranslationLink): Report a lot
more errors.
2008-10-29 00:54:43 +00:00
Alex Schroeder
69d047dff7 *** empty log message *** 2008-10-28 21:47:56 +00:00
Alex Schroeder
d171a57fda (DoTranslationLink): Added better summary. 2008-10-28 21:32:33 +00:00
Alex Schroeder
0680720e7b (TranslationLinkNewGetFooterLinks):
Fix links generated with %TranslationLinkTarget.
2008-10-28 20:17:21 +00:00
Alex Schroeder
fa7b65e275 New. 2008-10-28 19:57:51 +00:00
Alex Schroeder
4869866cb5 (OddMuse::Tokenize): Make the regexp
reusable outside the class.
(process): Use it.
(NewSearchFreeTextTitleAndBody): No longer strip quotes from tags.
(SearchFreeTextGet): Rewrote phrase handling so that tags can be
made mandatory by enclosing them with quotes, but making sure that
extra effort is only spent if there are multiple search terms.
Also if the terms are in fact whole tokens and not just any
phrase, avoid looking opening the page files and doing a regular
search.
2008-10-26 11:27:21 +00:00
Alex Schroeder
1a36186e92 (TocRule, TocHeadings): Make sure no h1 headers
can be generated. This makes sure that the headings work just like
they do in the UseMod markup extension.
2008-10-25 16:31:26 +00:00
Alex Schroeder
bb4a92133d Added some POD 2008-10-25 13:06:50 +00:00
Alex Schroeder
5f013a9eae (process): Allow underscore in
tokens (foo_bar).
(SearchFreeTextTagsRule): Add double quotes around tags that
contain a space ("foo bar"). This should work for technorati links
and the like.
(SearchFreeTextIndex): When indexing a tag containing a space, use
underscores instead ([[tag:foo bar]] is indexed as foo_bar).
(SearchFreeTextCloud): When showing a tag containing an
underscore, replace it with space (foo bar).
(NewSearchFreeTextTitleAndBody): When searching for tags, strip
quotes and replace spaces with underscores. Searching for tag:"foo
bar" will thus result in a search for the tag foo_bar.
(SearchFreeTextGet): No longer tags a tag flag as an argument.
This also affects all the callers (NewSearchFreeTextTitleAndBody).
As tags will end up without quotes and with spaces replaced by
underscores, the special case for tags is gone.
2008-10-24 14:26:21 +00:00
Brian Curry
9613b7608a * modules/wiki.pl (OpenHtmlEnvironment): Generalized list closure
by delegating that closure to the "CloseHtmlEnvironments" function.
This permits other extensions (namely, the Creole Markup extension)
to redefine the "CloseHtmlEnvironments" function and thereby
precisely override just when and how list markup is closed.
* modules/creole.pl ($CreoleDashStyleUnorderedLists): New option.
(RunMyRules): New function.
(CreoleRule): Improved conformance to the Wiki Creole standard by
strictly requiring, among other notable things, that horizontal
rules consist of four and only four dashes, that all image links
to images on the Wiki (e.g., image "FreeLinks") be marked as dirty
blocks, that the nowiki markup strictly require the opening and
closing three braces to reside on their own lines having no other
markup, and that preformatted code not extend over multiple blocks.
(CreoleListAndNewLineRule): Avoid handling dash-style unordered
list markup unless explicitly requested by the new
"$CreoleDashStyleUnorderedLists" option being set to 1 (since
that markup is non-standard, and explicitly contradicts the Wiki
Creole standard).
* t/creole.t: Adjusted tests broken by the above modifications;
these were, typically, tests for nowiki and preformatted markup
that assumed a less conformant, gentler handling of that markup.
2008-10-24 04:34:09 +00:00
Alex Schroeder
32f1dee9fa (NewNearLinksResolveId): Make sure that
comment links are "forbidden" -- they never redirect to a remote
place.
2008-10-22 14:01:05 +00:00
Brian Curry
30a8542a70 * modules/poetry.pl (PoetryInit): New function.
(PoetryRule): Generalized markup handling so as to avoid
conflict with HTML "div" tags produced by other markup
extensions.
2008-10-19 01:51:42 +00:00
Alex Schroeder
6ec6d83fa7 Copy the $BannedContent variable. 2008-10-16 04:53:17 +00:00
Alex Schroeder
bf9223d2c3 Whitespace 2008-10-15 22:18:48 +00:00
Alex Schroeder
59958d551c (LogBannedContent): Don't remap
BannedContent again.
2008-10-15 22:17:47 +00:00
Alex Schroeder
87685605d4 (DoSitemap): Simplified. No longer requires
the admin password because it no longer opens all the pages to get
at the timestamp. Now uses sitemap 0.9 as documented here:
https://www.google.com/webmasters/tools/docs/en/protocol.html
2008-10-12 21:23:31 +00:00
Brian Curry
9ffc097412 * modules/hibernal.pl (HibernalInit): Implemented context-
dependent defaults for $HibernalPostCommentsAuthorshipMarkup.
(AssayHibernalPostBounds): Corrected several obscure, but
damaging, edge-cases. (This necessitated a rewrite of the
algorithm, unfortunately.)
2008-10-11 13:06:44 +00:00
Alex Schroeder
800c45834b (CreoleRule): Fix dirty block handling for the
[[page]] and [[page|text]] rules.
2008-10-06 22:51:50 +00:00
Brian Curry
514878af35 * modules/creole.pl (CreoleRule): Allow one newline character following an explicit pipe character to end a table. 2008-10-06 22:21:17 +00:00
Brian Curry
f583456681 * wiki.pl (ApplyRules): Ensure the regular expression match
position returns the length of the matched string on finishing
application of all rules. ("creole.pl" and "creoleaddition.pl" now
depend on this; it notifies them that rules are now finished.)
* modules/creoleaddition.pl (CreoleAdditionRule): Injected a sanity
check, to ensure closure of blockquotes at the end of a page.
* modules/creole.pl ($CreoleTableCellsAllowBlockLevelElements): New
option.
* modules/creole.pl (CreoleRule): The last, one hopes, of all Creole
table markup modifications (for the moment). The rather complex
table markup code has been modified so as to use the new option, has
been refactored for robustness and strict conformance to the Wiki
Creole standard, and has been well-documented.
* modules/creole.pl (CreoleGetTableHtmlAttributes): Deleted function.
2008-10-06 06:11:20 +00:00
Alex Schroeder
a32b1eaaa5 Copyright year, GPLv3 2008-10-04 22:31:11 +00:00
Alex Schroeder
1587adcc79 (DoAtom): Call print GetRcAtom instead of DoRc
GetRcAtom.
(GetRcAtom): Call ProcessRcLines instead of GetRc.
(DoAtomSave): No longer call DeletePermanentAnchors.
2008-10-04 22:30:20 +00:00
Alex Schroeder
c8025e67af (CreoleRule): Added link around image for the
[[url|{{url}}]] rule.
2008-10-04 11:07:54 +00:00
Brian Curry
0fd92d4419 * modules/creole.pl (CreoleRuleRecursive): New function. Permits embedding
of Wiki Creole syntax within Wiki Creole syntax. (Yes... This is confusing?)
* modules/creole.pl (CreoleRule): Used the new function. Specifically, you
can now embed Creole and CreoleAddition syntax (such as bold, italics, small
caps, and so on) within URL and Wiki link text, ala
  "[[Some_Page|Wow! **Quite** an //%%interesting page%%// page, here]]."
* modules/creoleaddition.pl (CreoleAdditionRule): Renamed function from
"CreoleAdditionRules" to this.
2008-10-04 03:30:50 +00:00
Brian Curry
ea6ff73796 (CreoleAdditionRules): Corrected the definition list term's regular expression, which I'd quite munted with an earlier commit. 2008-10-02 00:12:04 +00:00
Brian Curry
674cb60c3d * modules/creole.pl: "There be dragons, here." This module now
supports a significantly stabler, more robust syntax--including:
multiline table cells, block level elements in table cells, CSS
stylization for images and image links, simpler, more efficient
regular expressions, new perldoc-style documentation, and a subtle
slew of other bug fixes. "Huzzah!"
* modules/creoleaddition.pl (AddOrCloseCreoleAdditionEnvironment): New
function.
(CreoleAdditionRules): Usage of the new function.
* t/creole.pl: Corrected all non-XPath-dependent tests.
* t/creoleaddition.pl: Corrected all non-XPath-dependent tests.
2008-10-01 07:54:44 +00:00