Khác biệt giữa bản sửa đổi của “Trợ giúp:Cước chú”

Nội dung được xóa Nội dung được thêm vào
Dòng 170:
 
===Cước chú lồng nhau===
ThereMột ishạn achế knownđã limitationđược inbiết mediawikiđến thatcủa certainphần tagsmềm suchMediaWiki asđó là một số thẻ nhất định như [[mw:extension:Cite|<ref>]] aresẽ được xử lý parsedtuần intự athay linear rathertheo thankiểu hierarchicphân fashioncấp, resultingdẫn inđến constructionscách suchviết asnhư:
<syntaxhighlight lang="HTML5">ThisĐây is amột basiccâu lệnh cơ bản<ref>NotKhông phải<ref>HereĐây is an opportunityhội forđể aviết reallyđiều bad punhài hước.</ref> the computerngôn languagengữ lập trình!</ref> statement.<references/></syntaxhighlight>
unexpectedlysẽ resultingtạo inra kết quả không mong muốn là: {{boxhộp|ThisĐây is amột basiccâu lệnh cơ bản<ref>NotKhông phải<ref>HereĐây is an opportunityhội forđể aviết reallyđiều bad punhài hước.</ref> the computerngôn languagengữ lập trình!</ref> statement.<references/>}}—due—do tophần themềm parserxử attempting tosẽ matchcố thegắng firstso occurrencetrùng oflần hiện ra đầu tiên của <code>&lt;/ref&gt;</code> backtrở tolại thelần firsthiện occurrencera ofđầu tiên của <code>&lt;ref&gt;</code> insteadthay of toso thetrùng với lần xuất hiện ''innermosttrong cùng'' occurrencevà rồi andsau generallyđó thereaftersẽ becomingbị confusedrối.
 
Tuy nhiên một giải pháp là dùng một cú pháp cũ kỹ nhưng tránh được hành vi trên. Đoạn văn bản có thể được viết lại thành:
However resort may be made in these instances to a much older syntax which is somewhat resistant to this behaviour. This same sequence may be re-expressed as:
<syntaxhighlight lang="HTML5">ThisĐây is amột basiccâu lệnh cơ bản{{#tag:ref|NotKhông phải<ref>HereĐây is an opportunityhội forđể aviết reallyđiều bad punhài hước.</ref> the computerngôn languagengữ lập trình!}} statement.<references/></syntaxhighlight>
whichsẽ producescho somethingra closerkết toquả thegiống expectednhư resultmong đợi hơn:{{boxhộp|ThisĐây is amột basiccâu lệnh cơ bản{{#tag:ref|NotKhông phải<ref>HereĐây is an opportunityhội forđể aviết reallyđiều bad punhài hước.</ref> the computerngôn languagengữ lập trình!}} statement.<references/>}}—but—nhưng sadlyrất tiếc, thecước footnoteschú arevẫn stillbị "out-of-order"sai thứ withtự regardsso tovới normalmong expectationđợi. SoDo additionallyđó applying lessonsnếu fromchúng theta áp dụng cách dùng cước chú gom nhóm [[#GroupedCước chú được gom thành footnotesnhóm|formertrong sectionphần trước]]: <syntaxhighlight lang="HTML5">ThisĐây là một câu islệnh a basicbản{{#tag:ref|NotKhông phải<ref group="I">HereĐây is an opportunityhội forđể aviết reallyđiều bad punhài hước.</ref> the computerngôn languagengữ lập trình!|group="O"}} statement.<references group="O"/><references group="I"/></syntaxhighlight>N.B. group names "I" and "O" are entirely arbitrary and here are simply chosen to represent '''I'''nner and '''O'''uter nesting levels.
 
ThisNội newdung codingmới resultssẽ intạo ra: {{boxhộp|ThisĐây is amột basiccâu lệnh cơ bản{{#tag:ref|NotKhông phải<ref group="I">HereĐây is an opportunityhội forđể aviết reallyđiều bad punhài hước.</ref> the computerngôn languagengữ lập trình!|group="O"}} statement.<references group="O"/><references group="I"/>}}
 
===Multiple references that point to the same footnote===