GithubHelp home page GithubHelp logo

Comments (5)

naoya avatar naoya commented on September 27, 2024

本文と引用箇所でテキストの取り扱い方が変わる理由も教えてください。

必ずしも雑誌の出力と、Markdown や HTML 的な考え方を合わせる必要はないとは思ってはいますが、僕がなぜそういう質問をしているか理解してもらうために、念のため説明しておきます。

HTML 的には、本文箇所 (<p> ブロック) と引用ブロック (<blockquote>) 内は、ブロックが異なるだけでその中におけるテキストそのものの処理の仕方は同じです。というのは、テキストは「text要素」として取り扱われる。ので、あくまで「本文ブロックの中の text要素」「引用ブロックの中の text要素」という扱いになります。

・・・というか、text要素もそうですが、<p><blockquote> のブロック内では text 要素意外にも ul や dl など他の要素が出現する可能性もある。つまり文章の論理構造が入れ子になる前提になっているので、p ブロックでも blockquote ブロックでもその中身の処理は再帰的に処理するように解釈するのが正しい解釈の仕方です。

で、text 要素はいずれも場合でも text 要素なので、今はそれを同じ処理で共通化させています。(つまり、本文と引用箇所で(マークアップではなく) text の論理構造が変わる・・・というのは HTML や Markdown 的な考え方からは微妙だと思うということ。) 件の仕様を実現するにはコンテキストを考慮してそのコンテキストごとに text 要素の処理の仕方を分岐させる必要があります。

その、分岐させる実装自体は全く難しくないのですが、論理的整合性という点では分岐しないほうがより理に叶っているので可能ならそのままにしておきたい。あるいは、(それは選択肢には入らないのは分かっていて敢えて書きますが) 本文側の text も同じ仕様にしておきたい、ということです。

原稿を書く側の立場に立っても (HTML を正しく理解している人ほど)、両者で text の構造が変わるのは想定外に感じるだろう、とも思います。

from md2inao.

inao avatar inao commented on September 27, 2024

ご質問の意味を取り違えている気もするのですが、本文と引用箇所でテキストの取り扱い方を 揃える お願いをしたつもりでした。

本文が以下の記法で段落分けされるなら、

本文です。

次の段落の本文です。

引用も以下のいずれかで段落分けされたほうが、記法として一貫している気がします。

> 引用です。
> 
> 次の段落の引用です。
> 引用です。

> 次の段落の引用です。

md2inaoのinaoへの変換では、上記はいずれも段落分けされたものに変換されていますので、その点からも一貫性を持たせたつもりでした。

from md2inao.

naoya avatar naoya commented on September 27, 2024

ああ、すいません、僕のほうが勘違いしていたようです。失礼しました。

で、inao と InDesign で同じようになってると思っていまテストしたら違ってた。バグですねこれ。修正します

from md2inao.

inao avatar inao commented on September 27, 2024

ありがとうございます!

from md2inao.

naoya avatar naoya commented on September 27, 2024

Fixed

from md2inao.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.