-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Centering / section justification tracking issue #668
Comments
I love this proposal – I certainly would need it in the not so far future 😅
I have two questions: currently the Markers only allow Would it be possible to remove this restriction? And what are your thoughts about non-string attributes (that are not rendered in the default editor renderer, but in a custom one)? |
@apfelbox I'm not sure why those constraints are in place except to somewhat defensively code such that it forces to follow markup spec. Someone else might be able to shed some light on why the code is as it is and we can pursue allowing diff attributes via some configuration. |
@apfelbox the restriction on attributes ensures that the mobiledoc document format itself is portable. For example if we document If we permit arbitrary attributes we will empower Mobiledoc users to create their own bespoke versions of Mobiledoc which can't benefit from shared tooling, shared rendering, and interoperability (full fidelity copy/paste for exmaple). Now if you don't care about of that stuff and you really insist, The whitelists for attributes/elements are all just arrays in JS. I know some people import those and add bespoke attributes for example. Just keep in mind that by doing so you've effectively opted in to a bespoke, unique document format. A goal of Mobiledoc was to avoid that very end point. The alternative is that you think about how your bespoke change can be generalized into a part of the Mobiledoc format and official editor/renderer. That is exactly what is being done in this ticket. You could already hack this via private API, now we're making it public/documented API. tl;dr I don't expect Mobiledoc will every allow arbitrary tags or attributes because that would be at odds with our baseline goals for interoperability and common tools. If you want to break with that for now you can hack it through private APIs. We won't go out of our way to block people doing this. |
WIP PR to implement above: #670 |
Hi @mixonic, thank you for your long and detailed explanation, I really appreciate it! I understand you viewpoint and share it. However I would like to show you my use case and where I am coming from: Again – I completely understand your motivations, but having to import a global array (and trusting the module bundler that all imports are singletons – which isn't guaranteed by anything) and modifying it... seems weird. Maybe you could move the check from the Markup constructor to Right now we also have to use horrible hacks, that I would like to get rid of, but I am not really comfortable with exchanging one hack with another sort-of hack. You can already create atoms and cards that aren't portable – in this case it seems fine to have "black box content elements" – but with markup it doesn't? I understand if you decide that this is out of scope / explicitly not desired, but just wanted to provide you with our use case. Thanks anyway again, though 😊 |
Upon initial consideration I believe the text renderer can safely remain unchanged since the presence or absence of the attributes in the section won't affect it. Marking as completed, unless someone has a better insight than me. 🍻 |
I think this is ready for a more thorough review @mixonic (if/when you have the time) 😄 |
@rondale-sc how's this one coming along? |
@ZeeJab This and the other review here is on me! I will take a deep look early this week. |
@mixonic 👋 👋 😄 |
@mixonic hi 👋 |
@mixonic 😅 |
I've been getting caught up on the work for this. The main WIP PRs are:
These need to be cleaned up to bump the Mobiledoc spec implementation instead of modifying the 0.3.1 spec. I'll be doing this. |
The main chunks of work necessary for this are as follows:
data-md-text-align
. Thedata-md-
namespace for attributes will be where we create any future section attributes. Like with markers arbitrary attributes (likeclass
,style
, etc) are not part of the spec though it seems like that has not stopped anyone from adding them.We'll likely need to add something to the EditorDom to wrap sections in an element with a style tag for centering et, al
The text was updated successfully, but these errors were encountered: