/* ---------------------------------------------------------------------- * MocaScript File * $Id: hopHTMLHeadings.ms,v 1.4 2004/07/05 14:05:57 nzawa Exp nzawa $ * * [Title] * 少しだけ賢いHTMLの見出しジャンプ * * [Description] * Peggyには[次のブロック][前のブロック]で見出し行にジャンプする * 機能が実装されていますが、HTMLの場合、h[1-6]要素の開始タグが属性を * 持っていると見出しだと認識されません。 * (ac_web.dllが持っている見出しパターンを修正するだけで対応出来る?) * * このスクリプトを使うと、属性を持ったh[1-6]要素の開始タグも見出しと * 認識してジャンプ出来ます。言語識別名が"HTML40"の時以外はPeggyに元々 * ある[次のブロック][前のブロック]を呼出すだけなので、Alt+. Alt+, * に割当てると便利だと思います。 * * また、HTMLの見出しも少し賢く解析出来ます。 * こちらも、言語識別子が"HTML40"の時だけスクリプト側で処理を行い、 * それ以外の時はPeggyに組込まれている[見出し解析]を呼出します。 * * [Remarks] * 言語識別名が"HTML40"の時以外はPeggyに元々ある * [次のブロック][前のブロック]を呼出します。 * PHPなど他の言語でもこのスクリプトの機能を使いたい場合は、 * 適時スクリプトを書換えて下さい。 * * * Copyright (c) 2003-2004 Nzawa * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or * sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * ----------------------------------------------------------------------*/ ///////////////////////////////////////////////////////////////////////////// // コマンド宣言 #command GotoNextHeading "次の見出しへジャンプ(&N)" #command GotoPreviousHeading "前の見出しへジャンプ(&P)" #command AnalyzeHeadings "見出しを解析(&O)" ///////////////////////////////////////////////////////////////////////////// // 設定 var headingPattern = /